diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index c1c3d2f..8f9a479 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -1,4 +1,4 @@ -name: CI +name: "Tests" on: pull_request: @@ -9,45 +9,29 @@ on: - master 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/') }} + cancel-in-progress: ${{ github.ref_name != github.event.repository.default_branch || github.ref != 'refs/tags/v*' }} jobs: - test: - runs-on: ubuntu-latest + tests: + name: "Tests" strategy: fail-fast: false matrix: + version: + - "1" + - "lts" project: - '.' - - lib/DAEProblemLibrary - - lib/DDEProblemLibrary - - lib/JumpProblemLibrary - - lib/ODEProblemLibrary - - lib/SDEProblemLibrary - - lib/BVProblemLibrary - - lib/NonlinearProblemLibrary - version: - - '1' - steps: - - uses: actions/checkout@v4 - - uses: julia-actions/setup-julia@v2 - with: - version: ${{ matrix.version }} - - uses: julia-actions/cache@v2 - - uses: julia-actions/julia-buildpkg@v1 - with: - project: ${{ matrix.project }} - - uses: julia-actions/julia-runtest@v1 - with: - project: ${{ matrix.project }} - - uses: julia-actions/julia-processcoverage@v1 - with: - directories: ${{ matrix.project }}/src - - uses: codecov/codecov-action@v4 - with: - files: lcov.info - token: ${{ secrets.CODECOV_TOKEN }} - fail_ci_if_error: true + - 'lib/DAEProblemLibrary' + - 'lib/DDEProblemLibrary' + - 'lib/JumpProblemLibrary' + - 'lib/ODEProblemLibrary' + - 'lib/SDEProblemLibrary' + - 'lib/BVPProblemLibrary' + - 'lib/NonlinearProblemLibrary' + uses: "SciML/.github/.github/workflows/tests.yml@v1" + with: + julia-version: "${{ matrix.version }}" + project: "${{ matrix.project }}" + secrets: "inherit" diff --git a/.github/workflows/FormatCheck.yml b/.github/workflows/FormatCheck.yml index 7d1634f..eccaa61 100644 --- a/.github/workflows/FormatCheck.yml +++ b/.github/workflows/FormatCheck.yml @@ -1,10 +1,9 @@ -name: format-check +name: "Format Check" on: push: branches: - 'master' - - 'release-' tags: '*' pull_request: @@ -15,33 +14,6 @@ concurrency: cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: julia-actions/setup-julia@v2 - with: - version: 1 - - name: Install JuliaFormatter - run: | - using Pkg - name = "JuliaFormatter" - uuid = "98e50ef6-434e-11e9-1051-2b60c6c9e899" - Pkg.add(; name, uuid) - shell: julia --color=yes {0} - - name: Format Julia code - run: | - using JuliaFormatter - format("."; verbose = true) - shell: julia --color=yes {0} - - name: Format check - run: | - out = Cmd(`git diff --name-only`) |> read |> String - if out == "" - exit(0) - else - @error "Some files have not been formatted !!!" - write(stdout, out) - exit(1) - end - shell: julia --color=yes {0} + format-check: + name: "Format Check" + uses: "SciML/.github/.github/workflows/format-check.yml@v1" diff --git a/.github/workflows/Invalidations.yml b/.github/workflows/Invalidations.yml index 66c86a3..34eb7a9 100644 --- a/.github/workflows/Invalidations.yml +++ b/.github/workflows/Invalidations.yml @@ -1,4 +1,4 @@ -name: Invalidations +name: "Invalidations" on: pull_request: @@ -10,31 +10,6 @@ concurrency: cancel-in-progress: true jobs: - evaluate: - # Only run on PRs to the default branch. - # In the PR trigger above branches can be specified only explicitly whereas this check should work for master, main, or any other default branch - if: github.base_ref == github.event.repository.default_branch - runs-on: ubuntu-latest - steps: - - uses: julia-actions/setup-julia@v2 - with: - version: '1' - - uses: actions/checkout@v4 - - uses: julia-actions/julia-buildpkg@v1 - - uses: julia-actions/julia-invalidations@v1 - id: invs_pr - - - uses: actions/checkout@v4 - with: - ref: ${{ github.event.repository.default_branch }} - - uses: julia-actions/julia-buildpkg@v1 - - uses: julia-actions/julia-invalidations@v1 - id: invs_default - - - name: Report invalidation counts - run: | - echo "Invalidations on default branch: ${{ steps.invs_default.outputs.total }} (${{ steps.invs_default.outputs.deps }} via deps)" >> $GITHUB_STEP_SUMMARY - echo "This branch: ${{ steps.invs_pr.outputs.total }} (${{ steps.invs_pr.outputs.deps }} via deps)" >> $GITHUB_STEP_SUMMARY - - name: Check if the PR does increase number of invalidations - if: steps.invs_pr.outputs.total > steps.invs_default.outputs.total - run: exit 1 + evaluate-invalidations: + name: "Evaluate Invalidations" + uses: "SciML/.github/.github/workflows/invalidations.yml@v1"