Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: standardize workflows using SciML's reusable workflows #133

Merged
merged 3 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 19 additions & 35 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: "Tests"

on:
pull_request:
Expand All @@ -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"
36 changes: 4 additions & 32 deletions .github/workflows/FormatCheck.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
name: format-check
name: "Format Check"

on:
push:
branches:
- 'master'
- 'release-'
tags: '*'
pull_request:

Expand All @@ -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"
33 changes: 4 additions & 29 deletions .github/workflows/Invalidations.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Invalidations
name: "Invalidations"

on:
pull_request:
Expand All @@ -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"
Loading