|
| 1 | +name: CI Test on Metal |
| 2 | +on: [pull_request] |
| 3 | + |
| 4 | +concurrency: |
| 5 | + group: "${{ github.workflow }}-${{ github.ref }}" |
| 6 | + cancel-in-progress: ${{ github.event_name == 'pull_request' }} |
| 7 | + |
| 8 | +env: |
| 9 | + PYTHON_VERSION: '3.12' |
| 10 | + VENV_DIR: tilelang_ci |
| 11 | + |
| 12 | +jobs: |
| 13 | + format-check: |
| 14 | + runs-on: [macos-latest] |
| 15 | + |
| 16 | + permissions: |
| 17 | + contents: write |
| 18 | + |
| 19 | + steps: |
| 20 | + - name: Checkout repository |
| 21 | + uses: actions/checkout@v5 |
| 22 | + with: |
| 23 | + fetch-depth: 0 |
| 24 | + submodules: recursive |
| 25 | + |
| 26 | + - name: Install python via uv |
| 27 | + uses: astral-sh/setup-uv@v7 |
| 28 | + with: |
| 29 | + enable-cache: true |
| 30 | + ignore-nothing-to-cache: true |
| 31 | + activate-environment: true |
| 32 | + python-version: ${{ env.PYTHON_VERSION }} |
| 33 | + |
| 34 | + - name: Ensure venv (local & persistent) |
| 35 | + run: | |
| 36 | + [[ -f requirements-test.txt ]] && \ |
| 37 | + uv pip install -r requirements-test.txt --no-build-isolation |
| 38 | +
|
| 39 | + - name: Run format check |
| 40 | + run: | |
| 41 | + set -ex |
| 42 | + mkdir -p build |
| 43 | + # run cmake to create the build directory with compile_commands.json |
| 44 | + cd build; cmake .. -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DUSE_METAL=ON; cd .. |
| 45 | + if ! output=$(./format.sh 2>&1); then |
| 46 | + echo "------------------------------------" |
| 47 | + echo "message:" |
| 48 | + echo "$output" |
| 49 | + printf '%s\n' "$output" |
| 50 | + echo "------------------------------------" |
| 51 | + exit 1 |
| 52 | + fi |
| 53 | +
|
| 54 | + build-test-metal: |
| 55 | + runs-on: [macos-latest] |
| 56 | + needs: format-check |
| 57 | + permissions: |
| 58 | + contents: read |
| 59 | + env: |
| 60 | + CMAKE_C_COMPILER_LAUNCHER: ccache |
| 61 | + CMAKE_CXX_COMPILER_LAUNCHER: ccache |
| 62 | + steps: |
| 63 | + - name: Checkout repository |
| 64 | + uses: actions/checkout@v5 |
| 65 | + with: |
| 66 | + fetch-depth: 1 |
| 67 | + submodules: recursive |
| 68 | + |
| 69 | + - name: ccache |
| 70 | + uses: hendrikmuhs/ccache-action@v1.2 |
| 71 | + with: |
| 72 | + create-symlink: true |
| 73 | + key: ${{ github.job }}-${{ matrix.os }} |
| 74 | + |
| 75 | + - name: Install python via uv |
| 76 | + uses: astral-sh/setup-uv@v7 |
| 77 | + with: |
| 78 | + enable-cache: true |
| 79 | + ignore-nothing-to-cache: true |
| 80 | + activate-environment: true |
| 81 | + python-version: ${{ env.PYTHON_VERSION }} |
| 82 | + |
| 83 | + - name: Ensure venv (local & persistent) |
| 84 | + run: uv pip install -r requirements-test.txt -r requirements-build.txt |
| 85 | + |
| 86 | + - name: Build wheel |
| 87 | + run: | |
| 88 | + source .venv/bin/activate |
| 89 | + uv pip install -v --no-build-isolation . |
| 90 | +
|
| 91 | + - name: Run metal test |
| 92 | + run: | |
| 93 | + cd testing/python |
| 94 | + unset PYTHONPATH |
| 95 | + python -m pytest -k metal -v -r fE --durations=0 --cache-clear --timeout=3600 |
0 commit comments