Skip to content

Commit

Permalink
[ci] Add step to run unit tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
stellaraccident committed Jan 28, 2024
1 parent 77c14ab commit db7d469
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,13 @@ jobs:
path: ${{ env.CACHE_DIR }}
key: build-test-cpp-asserts-manylinux-v2-${{ github.sha }}

- name: Test project (torch-${{ matrix.torch-version }})
- name: Unit tests
run: |
export cache_dir="${{ env.CACHE_DIR }}"
bash build_tools/ci/unit_test_posix.sh
- name: Integration tests (torch-${{ matrix.torch-version }})
run: |
bash build_tools/ci/test_posix.sh ${{ matrix.torch-version }}
- name: Check generated sources (torch-nightly only)
Expand Down
17 changes: 17 additions & 0 deletions build_tools/ci/unit_test_posix.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

set -eu -o errtrace

this_dir="$(cd $(dirname $0) && pwd)"
repo_root="$(cd $this_dir/../.. && pwd)"
torch_version="${1:-unknown}"

export CMAKE_TOOLCHAIN_FILE="$this_dir/linux_default_toolchain.cmake"
export CC=clang
export CXX=clang++
export CCACHE_DIR="${cache_dir}/ccache"
export CCACHE_MAXSIZE="350M"
export CMAKE_C_COMPILER_LAUNCHER=ccache
export CMAKE_CXX_COMPILER_LAUNCHER=ccache

cmake --build $repo_root/build --target check-torch-mlir-all

0 comments on commit db7d469

Please sign in to comment.