| name: Julia Enzyme CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| merge_group: | |
| 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: Enzyme CI Julia ${{ matrix.version }} ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| permissions: | |
| actions: write | |
| contents: read | |
| continue-on-error: ${{ matrix.version == 'nightly' }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| version: | |
| - '1.10' | |
| - '1.11' | |
| - '1.12' | |
| - '1.13' | |
| os: | |
| - ubuntu-latest | |
| arch: | |
| - 'default' | |
| timeout-minutes: 60 | |
| steps: | |
| - name: Checkout Enzyme repository | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| persist-credentials: false | |
| - name: Checkout Enzyme.jl repository | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| persist-credentials: false | |
| repository: 'EnzymeAD/Enzyme.jl' | |
| path: ./jl | |
| ref: main | |
| - uses: julia-actions/setup-julia@v2 | |
| with: | |
| version: ${{ matrix.version }} | |
| arch: ${{ matrix.arch }} | |
| - uses: julia-actions/cache@v3.2.0 | |
| with: | |
| gcp-bucket: ${{ (contains(matrix.os, 'linux') && 'enzyme-ci-transient' ) || '' }} | |
| key-prefix: enzyme-julia-int/ | |
| - name: Set environment variable to build libEnzyme | |
| if: ${{ runner.os == 'macOS' }} | |
| run: | | |
| echo "SDKROOT=$(xcrun --show-sdk-path)" >> "${GITHUB_ENV}" | |
| - name: Build libEnzyme | |
| run: | | |
| julia --color=yes --project=jl/deps -e 'using Pkg; Pkg.instantiate()' | |
| julia --color=yes --project=jl/deps jl/deps/build_local.jl ./enzyme | |
| - name: Dev EnzymeCore | |
| run: julia --color=yes --project=jl -e 'using Pkg; Pkg.develop(path="jl/lib/EnzymeCore")' | |
| - uses: julia-actions/julia-buildpkg@v1 | |
| with: | |
| project: jl | |
| - name: "Set test arguments" | |
| shell: bash | |
| run: | | |
| # Run tests in verbose mode | |
| TEST_ARGS=(--verbose) | |
| # if [[ ${{ runner.os }} == 'macOS' ]]; then | |
| # # Encourage ParallelTestRunner to use two jobs on macOS, rather | |
| # # than the single one it'd use by default. | |
| # TEST_ARGS+=(--jobs=2) | |
| # fi | |
| echo "runtest_test_args=${TEST_ARGS[@]}" >> "${GITHUB_ENV}" | |
| - uses: julia-actions/julia-runtest@v1 | |
| with: | |
| project: jl | |
| test_args: ${{ env.runtest_test_args }} |