Skip to content

Commit 3957332

Browse files
Merge pull request #375 from SciML/at/use-reusable-workflows
ci: standardise workflows using SciML's reusable workflows
2 parents 03de859 + f0729ed commit 3957332

File tree

4 files changed

+35
-118
lines changed

4 files changed

+35
-118
lines changed

.github/workflows/CI.yml

Lines changed: 18 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
name: CI
1+
name: "Tests"
2+
23
on:
34
pull_request:
45
branches:
@@ -10,40 +11,23 @@ on:
1011
- master
1112
paths-ignore:
1213
- 'docs/**'
14+
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: ${{ github.ref_name != github.event.repository.default_branch || github.ref != 'refs/tags/v*' }}
18+
1319
jobs:
14-
test:
15-
runs-on: ubuntu-latest
20+
tests:
21+
name: "Tests"
1622
strategy:
23+
fail-fast: false
1724
matrix:
18-
group:
19-
- Core
20-
- Downstream
2125
version:
22-
- '1'
23-
steps:
24-
- uses: actions/checkout@v4
25-
- uses: julia-actions/setup-julia@v2
26-
with:
27-
version: ${{ matrix.version }}
28-
- uses: actions/cache@v4
29-
env:
30-
cache-name: cache-artifacts
31-
with:
32-
path: ~/.julia/artifacts
33-
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
34-
restore-keys: |
35-
${{ runner.os }}-test-${{ env.cache-name }}-
36-
${{ runner.os }}-test-
37-
${{ runner.os }}-
38-
- uses: julia-actions/julia-buildpkg@v1
39-
- uses: julia-actions/julia-runtest@v1
40-
env:
41-
GROUP: ${{ matrix.group }}
42-
- uses: julia-actions/julia-processcoverage@v1
43-
with:
44-
directories: src,ext
45-
- uses: codecov/codecov-action@v4
46-
with:
47-
file: lcov.info
48-
token: ${{ secrets.CODECOV_TOKEN }}
49-
fail_ci_if_error: true
26+
- "1"
27+
group:
28+
- "Core"
29+
- "Downstream"
30+
uses: "SciML/.github/.github/workflows/tests.yml@v1"
31+
with:
32+
julia-version: "${{ matrix.version }}"
33+
secrets: "inherit"

.github/workflows/Documentation.yml

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,18 @@
1-
name: Documentation
1+
name: "Documentation"
22

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

10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: ${{ github.ref_name != github.event.repository.default_branch || github.ref != 'refs/tags/v*' }}
13+
1114
jobs:
12-
build:
13-
runs-on: ubuntu-latest
14-
steps:
15-
- uses: actions/checkout@v4
16-
- uses: julia-actions/setup-julia@latest
17-
with:
18-
version: '1'
19-
- name: Install dependencies
20-
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
21-
- name: Build and deploy
22-
env:
23-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For authentication with GitHub Actions token
24-
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # For authentication with SSH deploy key
25-
run: julia --project=docs/ --code-coverage=user docs/make.jl
26-
- uses: julia-actions/julia-processcoverage@v1
27-
- uses: codecov/codecov-action@v4
28-
with:
29-
file: lcov.info
30-
token: ${{ secrets.CODECOV_TOKEN }}
31-
fail_ci_if_error: true
15+
build-and-deploy-docs:
16+
name: "Documentation"
17+
uses: "SciML/.github/.github/workflows/documentation.yml@v1"
18+
secrets: "inherit"

.github/workflows/FormatCheck.yml

Lines changed: 4 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,13 @@
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

1110
jobs:
12-
build:
13-
runs-on: ${{ matrix.os }}
14-
strategy:
15-
matrix:
16-
julia-version: [1]
17-
julia-arch: [x86]
18-
os: [ubuntu-latest]
19-
steps:
20-
- uses: julia-actions/setup-julia@latest
21-
with:
22-
version: ${{ matrix.julia-version }}
23-
24-
- uses: actions/checkout@v4
25-
- name: Install JuliaFormatter and format
26-
# This will use the latest version by default but you can set the version like so:
27-
#
28-
# julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter", version="0.13.0"))'
29-
run: |
30-
julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter"))'
31-
julia -e 'using JuliaFormatter; format(".", verbose=true)'
32-
- name: Format check
33-
run: |
34-
julia -e '
35-
out = Cmd(`git diff --name-only`) |> read |> String
36-
if out == ""
37-
exit(0)
38-
else
39-
@error "Some files have not been formatted !!!"
40-
write(stdout, out)
41-
exit(1)
42-
end'
11+
format-check:
12+
name: "Format Check"
13+
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)