From 6c5e5e3924b67d3f05168eb4e71bac76d828e8ae Mon Sep 17 00:00:00 2001 From: Anant Thazhemadam Date: Wed, 8 May 2024 13:34:27 +0530 Subject: [PATCH 1/8] ci: update tests workflow to use centralised reusable workflow --- .github/workflows/CI.yml | 52 ------------------------------------- .github/workflows/Tests.yml | 25 ++++++++++++++++++ 2 files changed, 25 insertions(+), 52 deletions(-) delete mode 100644 .github/workflows/CI.yml create mode 100644 .github/workflows/Tests.yml diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml deleted file mode 100644 index ec04c117..00000000 --- a/.github/workflows/CI.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: CI -on: - pull_request: - branches: - - main - paths-ignore: - - "docs/**" - push: - branches: - - main - paths-ignore: - - "docs/**" -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: - test: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - version: - - "1" - steps: - - uses: actions/checkout@v4 - - uses: julia-actions/setup-julia@v2 - with: - version: ${{ matrix.version }} - - uses: actions/cache@v4 - env: - cache-name: cache-artifacts - with: - path: ~/.julia/artifacts - key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} - restore-keys: | - ${{ runner.os }}-test-${{ env.cache-name }}- - ${{ runner.os }}-test- - ${{ runner.os }}- - - uses: julia-actions/julia-buildpkg@v1 - - uses: julia-actions/julia-runtest@v1 - env: - BACKEND_GROUP: "CPU" - - uses: julia-actions/julia-processcoverage@v1 - with: - directories: src,ext - - uses: codecov/codecov-action@v4 - with: - files: lcov.info - token: ${{ secrets.CODECOV_TOKEN }} - fail_ci_if_error: true diff --git a/.github/workflows/Tests.yml b/.github/workflows/Tests.yml new file mode 100644 index 00000000..80e81163 --- /dev/null +++ b/.github/workflows/Tests.yml @@ -0,0 +1,25 @@ +name: "Tests" + +on: + pull_request: + branches: + - main + paths-ignore: + - 'docs/**' + push: + branches: + - main + paths-ignore: + - 'docs/**' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref_name != github.event.repository.default_branch || github.ref != 'refs/tags/v*' }} + +jobs: + tests: + name: "Tests" + uses: "SciML/.github/.github/workflows/tests.yml@v1" + with: + group: "CPU" + secrets: "inherit" From f144deb2056f6a4ee3d769a5bd18913852019a32 Mon Sep 17 00:00:00 2001 From: Anant Thazhemadam Date: Mon, 29 Jul 2024 14:45:29 +0200 Subject: [PATCH 2/8] ci: remove `FormatCheck` workflow Remove the `FormatCheck` workflow, since code in the repository should always be compliant with the SciML style, thus eliminating the need for automated formatting PRs. --- .github/workflows/FormatPR.yml | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 .github/workflows/FormatPR.yml diff --git a/.github/workflows/FormatPR.yml b/.github/workflows/FormatPR.yml deleted file mode 100644 index a09c193e..00000000 --- a/.github/workflows/FormatPR.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: format-pr -on: - schedule: - - cron: '0 0 * * *' -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Install JuliaFormatter and format - run: | - julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter"))' - julia -e 'using JuliaFormatter; format(".")' - # https://github.com/marketplace/actions/create-pull-request - # https://github.com/peter-evans/create-pull-request#reference-example - - name: Create Pull Request - id: cpr - uses: peter-evans/create-pull-request@v6 - with: - token: ${{ secrets.GITHUB_TOKEN }} - commit-message: Format .jl files - title: 'Automatic JuliaFormatter.jl run' - branch: auto-juliaformatter-pr - delete-branch: true - labels: formatting, automated pr, no changelog - - name: Check outputs - run: | - echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" - echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" From 528b4fd22500ef047a3184a8e62e1482131d3c4c Mon Sep 17 00:00:00 2001 From: Anant Thazhemadam Date: Mon, 29 Jul 2024 21:18:53 +0200 Subject: [PATCH 3/8] ci(format-check): automatically comment formatting suggestions on PRs --- .github/workflows/FormatCheck.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/FormatCheck.yml b/.github/workflows/FormatCheck.yml index 7e46c8db..fe9c1280 100644 --- a/.github/workflows/FormatCheck.yml +++ b/.github/workflows/FormatCheck.yml @@ -10,4 +10,4 @@ on: jobs: format-check: name: "Format Check" - uses: "SciML/.github/.github/workflows/format-check.yml@v1" + uses: "SciML/.github/.github/workflows/format-suggestions-on-pr.yml@v1" From e3ef2465b33befd9b8565d18bfd2deec794c1f7f Mon Sep 17 00:00:00 2001 From: Avik Pal Date: Fri, 6 Sep 2024 12:50:01 -0400 Subject: [PATCH 4/8] chore: rename to BACKEND_GROUP --- .github/workflows/Tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Tests.yml b/.github/workflows/Tests.yml index 80e81163..7a7f7f0f 100644 --- a/.github/workflows/Tests.yml +++ b/.github/workflows/Tests.yml @@ -21,5 +21,5 @@ jobs: name: "Tests" uses: "SciML/.github/.github/workflows/tests.yml@v1" with: - group: "CPU" + BACKEND_GROUP: "CPU" secrets: "inherit" From cbde81b7dfcc63400ec59d67d286a8ccd05c03ab Mon Sep 17 00:00:00 2001 From: Avik Pal Date: Fri, 6 Sep 2024 12:51:29 -0400 Subject: [PATCH 5/8] revert: rename to BACKEND_GROUP --- .github/workflows/Tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Tests.yml b/.github/workflows/Tests.yml index 7a7f7f0f..80e81163 100644 --- a/.github/workflows/Tests.yml +++ b/.github/workflows/Tests.yml @@ -21,5 +21,5 @@ jobs: name: "Tests" uses: "SciML/.github/.github/workflows/tests.yml@v1" with: - BACKEND_GROUP: "CPU" + group: "CPU" secrets: "inherit" From 9c4978f4eb769efcb12ffd9b28ce64cf3a664bb4 Mon Sep 17 00:00:00 2001 From: Avik Pal Date: Fri, 6 Sep 2024 12:52:34 -0400 Subject: [PATCH 6/8] fix: fallback to GROUP --- test/runtests.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/runtests.jl b/test/runtests.jl index 6ac0ba52..33e1f2c1 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -2,7 +2,7 @@ using ReTestItems, Pkg, InteractiveUtils, Hwloc @info sprint(versioninfo) -const BACKEND_GROUP = lowercase(get(ENV, "BACKEND_GROUP", "all")) +const BACKEND_GROUP = lowercase(get(ENV, "BACKEND_GROUP", get(ENV, "GROUP", "all"))) const EXTRA_PKGS = String[] (BACKEND_GROUP == "all" || BACKEND_GROUP == "cuda") && push!(EXTRA_PKGS, "LuxCUDA") From 4768c2c994c2bcab0a18909f108df82c5c86c6e1 Mon Sep 17 00:00:00 2001 From: Avik Pal Date: Fri, 6 Sep 2024 13:03:51 -0400 Subject: [PATCH 7/8] fix: fallback to GROUP --- test/shared_testsetup.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/shared_testsetup.jl b/test/shared_testsetup.jl index 0ad266d2..878a8aa4 100644 --- a/test/shared_testsetup.jl +++ b/test/shared_testsetup.jl @@ -6,7 +6,7 @@ using MLDataDevices, GPUArraysCore LuxTestUtils.jet_target_modules!(["DeepEquilibriumNetworks", "Lux", "LuxLib"]) -const BACKEND_GROUP = lowercase(get(ENV, "BACKEND_GROUP", "all")) +const BACKEND_GROUP = lowercase(get(ENV, "BACKEND_GROUP", get(env, "GROUP", "all"))) if BACKEND_GROUP == "all" || BACKEND_GROUP == "cuda" using LuxCUDA From 110b360e38395563c50496e891cfa795abd5df2a Mon Sep 17 00:00:00 2001 From: Avik Pal Date: Fri, 6 Sep 2024 13:13:45 -0400 Subject: [PATCH 8/8] fix: typo --- test/shared_testsetup.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/shared_testsetup.jl b/test/shared_testsetup.jl index 878a8aa4..18425967 100644 --- a/test/shared_testsetup.jl +++ b/test/shared_testsetup.jl @@ -6,7 +6,7 @@ using MLDataDevices, GPUArraysCore LuxTestUtils.jet_target_modules!(["DeepEquilibriumNetworks", "Lux", "LuxLib"]) -const BACKEND_GROUP = lowercase(get(ENV, "BACKEND_GROUP", get(env, "GROUP", "all"))) +const BACKEND_GROUP = lowercase(get(ENV, "BACKEND_GROUP", get(ENV, "GROUP", "all"))) if BACKEND_GROUP == "all" || BACKEND_GROUP == "cuda" using LuxCUDA