Skip to content

Commit 37d1364

Browse files
Merge pull request #133 from SciML/at/use-reusable-workflows
ci: standardize workflows using SciML's reusable workflows
2 parents 878c460 + 2fae387 commit 37d1364

File tree

3 files changed

+27
-96
lines changed

3 files changed

+27
-96
lines changed

.github/workflows/CI.yml

Lines changed: 19 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CI
1+
name: "Tests"
22

33
on:
44
pull_request:
@@ -9,45 +9,29 @@ on:
99
- master
1010

1111
concurrency:
12-
# Skip intermediate builds: always.
13-
# Cancel intermediate builds: only if it is a pull request build.
1412
group: ${{ github.workflow }}-${{ github.ref }}
15-
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
13+
cancel-in-progress: ${{ github.ref_name != github.event.repository.default_branch || github.ref != 'refs/tags/v*' }}
1614

1715
jobs:
18-
test:
19-
runs-on: ubuntu-latest
16+
tests:
17+
name: "Tests"
2018
strategy:
2119
fail-fast: false
2220
matrix:
21+
version:
22+
- "1"
23+
- "lts"
2324
project:
2425
- '.'
25-
- lib/DAEProblemLibrary
26-
- lib/DDEProblemLibrary
27-
- lib/JumpProblemLibrary
28-
- lib/ODEProblemLibrary
29-
- lib/SDEProblemLibrary
30-
- lib/BVProblemLibrary
31-
- lib/NonlinearProblemLibrary
32-
version:
33-
- '1'
34-
steps:
35-
- uses: actions/checkout@v4
36-
- uses: julia-actions/setup-julia@v2
37-
with:
38-
version: ${{ matrix.version }}
39-
- uses: julia-actions/cache@v2
40-
- uses: julia-actions/julia-buildpkg@v1
41-
with:
42-
project: ${{ matrix.project }}
43-
- uses: julia-actions/julia-runtest@v1
44-
with:
45-
project: ${{ matrix.project }}
46-
- uses: julia-actions/julia-processcoverage@v1
47-
with:
48-
directories: ${{ matrix.project }}/src
49-
- uses: codecov/codecov-action@v4
50-
with:
51-
files: lcov.info
52-
token: ${{ secrets.CODECOV_TOKEN }}
53-
fail_ci_if_error: true
26+
- 'lib/DAEProblemLibrary'
27+
- 'lib/DDEProblemLibrary'
28+
- 'lib/JumpProblemLibrary'
29+
- 'lib/ODEProblemLibrary'
30+
- 'lib/SDEProblemLibrary'
31+
- 'lib/BVPProblemLibrary'
32+
- 'lib/NonlinearProblemLibrary'
33+
uses: "SciML/.github/.github/workflows/tests.yml@v1"
34+
with:
35+
julia-version: "${{ matrix.version }}"
36+
project: "${{ matrix.project }}"
37+
secrets: "inherit"

.github/workflows/FormatCheck.yml

Lines changed: 4 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
name: format-check
1+
name: "Format Check"
22

33
on:
44
push:
55
branches:
66
- 'master'
7-
- 'release-'
87
tags: '*'
98
pull_request:
109

@@ -15,33 +14,6 @@ concurrency:
1514
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
1615

1716
jobs:
18-
build:
19-
runs-on: ubuntu-latest
20-
steps:
21-
- uses: actions/checkout@v4
22-
- uses: julia-actions/setup-julia@v2
23-
with:
24-
version: 1
25-
- name: Install JuliaFormatter
26-
run: |
27-
using Pkg
28-
name = "JuliaFormatter"
29-
uuid = "98e50ef6-434e-11e9-1051-2b60c6c9e899"
30-
Pkg.add(; name, uuid)
31-
shell: julia --color=yes {0}
32-
- name: Format Julia code
33-
run: |
34-
using JuliaFormatter
35-
format("."; verbose = true)
36-
shell: julia --color=yes {0}
37-
- name: Format check
38-
run: |
39-
out = Cmd(`git diff --name-only`) |> read |> String
40-
if out == ""
41-
exit(0)
42-
else
43-
@error "Some files have not been formatted !!!"
44-
write(stdout, out)
45-
exit(1)
46-
end
47-
shell: julia --color=yes {0}
17+
format-check:
18+
name: "Format Check"
19+
uses: "SciML/.github/.github/workflows/format-check.yml@v1"

.github/workflows/Invalidations.yml

Lines changed: 4 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Invalidations
1+
name: "Invalidations"
22

33
on:
44
pull_request:
@@ -10,31 +10,6 @@ concurrency:
1010
cancel-in-progress: true
1111

1212
jobs:
13-
evaluate:
14-
# Only run on PRs to the default branch.
15-
# In the PR trigger above branches can be specified only explicitly whereas this check should work for master, main, or any other default branch
16-
if: github.base_ref == github.event.repository.default_branch
17-
runs-on: ubuntu-latest
18-
steps:
19-
- uses: julia-actions/setup-julia@v2
20-
with:
21-
version: '1'
22-
- uses: actions/checkout@v4
23-
- uses: julia-actions/julia-buildpkg@v1
24-
- uses: julia-actions/julia-invalidations@v1
25-
id: invs_pr
26-
27-
- uses: actions/checkout@v4
28-
with:
29-
ref: ${{ github.event.repository.default_branch }}
30-
- uses: julia-actions/julia-buildpkg@v1
31-
- uses: julia-actions/julia-invalidations@v1
32-
id: invs_default
33-
34-
- name: Report invalidation counts
35-
run: |
36-
echo "Invalidations on default branch: ${{ steps.invs_default.outputs.total }} (${{ steps.invs_default.outputs.deps }} via deps)" >> $GITHUB_STEP_SUMMARY
37-
echo "This branch: ${{ steps.invs_pr.outputs.total }} (${{ steps.invs_pr.outputs.deps }} via deps)" >> $GITHUB_STEP_SUMMARY
38-
- name: Check if the PR does increase number of invalidations
39-
if: steps.invs_pr.outputs.total > steps.invs_default.outputs.total
40-
run: exit 1
13+
evaluate-invalidations:
14+
name: "Evaluate Invalidations"
15+
uses: "SciML/.github/.github/workflows/invalidations.yml@v1"

0 commit comments

Comments
 (0)