From a2c5046c2552a91e22a464d61d4bb8727d9da840 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mos=C3=A8=20Giordano?= Date: Fri, 14 Nov 2025 15:35:33 +0000 Subject: [PATCH 1/2] [CI] Dynamically generate list of packages to test --- .github/workflows/Integration.yml | 71 +++++++++++++++++++------------ 1 file changed, 43 insertions(+), 28 deletions(-) diff --git a/.github/workflows/Integration.yml b/.github/workflows/Integration.yml index d4cc0f9dc8..1805b98d6f 100644 --- a/.github/workflows/Integration.yml +++ b/.github/workflows/Integration.yml @@ -28,7 +28,28 @@ concurrency: cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} jobs: + generate-packages-list: + name: Generate list of packages for integration tests + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + - name: Set packages + id: set-packages + run: | + set -e + shopt -s globstar + # Find all test files and generate their list in JSON format + PACKAGES='packages=[' + for pkg in test/integration/*; do + PACKAGES="${PACKAGES}\"$(basename ${pkg})\"," + done + PACKAGES="${PACKAGES}]" + echo "${PACKAGES}" | tee "${GITHUB_OUTPUT}" + integration: + needs: generate-packages-list timeout-minutes: 45 name: Integration Tests - ${{ matrix.package }} - Julia ${{ matrix.version }} runs-on: ${{ matrix.os }} @@ -39,41 +60,35 @@ jobs: strategy: fail-fast: false matrix: + package: ${{ fromJson(needs.generate-packages-list.outputs.set-packages) }} version: - '1.10' - '1.11' os: - linux-x86-n2-32 - package: - - Bijectors - - DifferentiationInterface - - Distributions - - DynamicExpressions - - Lux - - SciML - - KernelAbstractions - - Molly - - MPI exclude: - version: '1.10' os: linux-x86-n2-32 package: Molly steps: - - uses: actions/checkout@v5 - - uses: julia-actions/setup-julia@v2 - with: - version: ${{ matrix.version }} - - uses: julia-actions/cache@v2 - - name: "Install Dependencies" - run: | - julia --color=yes --project=test/integration/${{ matrix.package }} --threads=auto --check-bounds=yes -O1 -e 'using Pkg; Pkg.develop([PackageSpec(; path) for path in (".", "lib/EnzymeCore")])' - shell: bash - if: ${{ matrix.version == '1.10' }} - - name: "Instantiate" - run: | - julia --color=yes --project=test/integration/${{ matrix.package }} --threads=auto --check-bounds=yes -O1 -e 'using Pkg; Pkg.instantiate()' - shell: bash - - name: "Run tests" - run: | - julia --color=yes --project=test/integration/${{ matrix.package }} --threads=auto --check-bounds=yes -O1 test/integration/${{ matrix.package }}/runtests.jl - shell: bash + - run: | + echo "Hello from ${{ matrix.package }} in Julia ${{ matrix.version }}" + + # - uses: actions/checkout@v5 + # - uses: julia-actions/setup-julia@v2 + # with: + # version: ${{ matrix.version }} + # - uses: julia-actions/cache@v2 + # - name: "Install Dependencies" + # run: | + # julia --color=yes --project=test/integration/${{ matrix.package }} --threads=auto --check-bounds=yes -O1 -e 'using Pkg; Pkg.develop([PackageSpec(; path) for path in (".", "lib/EnzymeCore")])' + # shell: bash + # if: ${{ matrix.version == '1.10' }} + # - name: "Instantiate" + # run: | + # julia --color=yes --project=test/integration/${{ matrix.package }} --threads=auto --check-bounds=yes -O1 -e 'using Pkg; Pkg.instantiate()' + # shell: bash + # - name: "Run tests" + # run: | + # julia --color=yes --project=test/integration/${{ matrix.package }} --threads=auto --check-bounds=yes -O1 test/integration/${{ matrix.package }}/runtests.jl + # shell: bash From 3ce300ecfe9efb43589d69de31f6c8dffd0e23a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mos=C3=A8=20Giordano?= Date: Fri, 14 Nov 2025 15:49:08 +0000 Subject: [PATCH 2/2] Use julia for scripting because that's a lot saner than bash --- .github/workflows/Integration.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/Integration.yml b/.github/workflows/Integration.yml index 1805b98d6f..b4ebd80f0b 100644 --- a/.github/workflows/Integration.yml +++ b/.github/workflows/Integration.yml @@ -32,21 +32,21 @@ jobs: name: Generate list of packages for integration tests runs-on: ubuntu-latest outputs: - matrix: ${{ steps.set-matrix.outputs.matrix }} + packages: ${{ steps.set-packages.outputs.packages }} steps: - uses: actions/checkout@v5 + - uses: julia-actions/setup-julia@v2 - name: Set packages id: set-packages + shell: julia --color=yes {0} run: | - set -e - shopt -s globstar - # Find all test files and generate their list in JSON format - PACKAGES='packages=[' - for pkg in test/integration/*; do - PACKAGES="${PACKAGES}\"$(basename ${pkg})\"," - done - PACKAGES="${PACKAGES}]" - echo "${PACKAGES}" | tee "${GITHUB_OUTPUT}" + all_pkgs = readdir("test/integration") + filtered_pkgs = all_pkgs + pkgs = string("packages=", filtered_pkgs) + open(ENV["GITHUB_OUTPUT"], "w") do io + print(stdout, pkgs) + print(io, pkgs) + end integration: needs: generate-packages-list @@ -60,12 +60,12 @@ jobs: strategy: fail-fast: false matrix: - package: ${{ fromJson(needs.generate-packages-list.outputs.set-packages) }} version: - '1.10' - '1.11' os: - linux-x86-n2-32 + package: ${{ fromJson(needs.generate-packages-list.outputs.packages) }} exclude: - version: '1.10' os: linux-x86-n2-32