Skip to content

Commit

Permalink
add unittest
Browse files Browse the repository at this point in the history
  • Loading branch information
yzh119 committed Nov 19, 2022
1 parent 32dc970 commit fff921b
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/unittest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Unittest
on:
push:
branches:
- main
jobs:
cleaner:
runs-on: self-hosted
steps:
- name: Clean up previous runs
run: rm -rf "${{ github.workspace }}"

build-docker-image:
runs-on: self-hosted
steps:
- uses: actions/checkout@v3
with:
submodules: true

- name: Generate Docker image tag
id: generate-tag
run: |
export TAG=sparsetir:$(date +%s)
echo "Docker image tag: $TAG"
echo "::set-output name=tag::$TAG"
- name: Build Docker image
run: |
DOCKER_BUILDKIT=1 docker build \
. \
--file docker/Dockerfile.ci_gpu \
--tag ${{ steps.generate-tag.outputs.tag }}
run-tests:
runs-on: self-hosted
needs: build-docker-image
steps:
- name: Run tests
run: docker run ${{ needs.build-docker-image.outputs.tag }} bash tests/scripts/task_python_sparsetir_unittest.sh
20 changes: 20 additions & 0 deletions tests/scripts/task_python_sparsetir_unittest.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env bash
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.


pytest tests/python/sparsetir

0 comments on commit fff921b

Please sign in to comment.