Update workspace.bzl #2038
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Enzyme-JAX | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- '.github/workflows/build.yml' | |
- '**/BUILD' | |
- '**/WORKSPACE' | |
- '**/*.bzl' | |
- 'builddeps/**' | |
- 'patches/**' | |
- 'src/**' | |
- 'test/**' | |
- 'third_party/**' | |
pull_request: | |
branches: | |
- main | |
paths: | |
- '.github/workflows/build.yml' | |
- '**/BUILD' | |
- '**/WORKSPACE' | |
- '**/*.bzl' | |
- 'builddeps/**' | |
- 'patches/**' | |
- 'src/**' | |
- 'test/**' | |
- 'third_party/**' | |
concurrency: | |
# Skip intermediate builds: always. | |
# Cancel intermediate builds: only if it is a pull request build. | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} | |
jobs: | |
build: | |
name: Build - ${{ matrix.os }} - python ${{ matrix.python }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu-latest | |
# `ubuntu-22.04-arm` is considered more stable than `ubuntu-24.04-arm`: | |
# <https://github.com/orgs/community/discussions/148648#discussioncomment-12099554>. | |
- ubuntu-22.04-arm | |
- macOS-latest | |
python: | |
- '3.12' | |
env: | |
HERMETIC_PYTHON_VERSION: ${{ matrix.python }} | |
steps: | |
- name: Make space on disk | |
run: sudo rm -rf /opt/* | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- uses: bazel-contrib/[email protected] | |
name: Set up Bazel | |
with: | |
# Avoid downloading Bazel every time. | |
bazelisk-cache: true | |
# Store build cache per workflow. | |
disk-cache: ${{ github.workflow }}-${{ matrix.os }}-${{ matrix.python }} | |
# Share repository cache between workflows. | |
repository-cache: true | |
bazelisk-version: 1.x | |
- name: Build enzymexlamlir-opt | |
timeout-minutes: 180 | |
run: | | |
bazel build --color=yes //:enzymexlamlir-opt --test_output=errors | |
- name: Build wheel | |
timeout-minutes: 240 | |
run: | | |
bazel build --color=yes :wheel --test_output=errors | |
- name: Upload wheel | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Enzyme-JAX-Wheel-${{ matrix.os }}-${{ matrix.python }} | |
path: "bazel-bin/*.whl" | |
retention-days: 90 | |
- name: Update Python requirements files | |
run: | | |
bazel run --color=yes //builddeps:requirements.update | |
- name: Run tests | |
if: ${{ !startsWith(matrix.os, 'ubuntu-') }} | |
run: | | |
bazel test --color=yes --test_output=errors --test_verbose_timeout_warnings //test/... | |
- name: Run lit tests | |
if: ${{ startsWith(matrix.os, 'ubuntu-') }} | |
run: | | |
bazel test --color=yes --test_output=errors --test_verbose_timeout_warnings $(find test/ -name '*.mlir' | awk '{print $1 ".test"}') | |
- name: Upload test results | |
uses: actions/upload-artifact@v4 | |
if: ${{ !cancelled() }} | |
with: | |
name: Enzyme-JAX-tests-${{ matrix.os }}-${{ matrix.python }} | |
path: | | |
bazel-out/**/test.log | |
retention-days: 90 |