Skip to content

Commit 6473d98

Browse files
Merge pull request #29 from SciML/dw/ci
Update CI
2 parents 5fe6013 + 0bc1554 commit 6473d98

File tree

4 files changed

+80
-71
lines changed

4 files changed

+80
-71
lines changed

.github/workflows/CI.yml

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,36 @@
11
name: CI
2+
23
on:
3-
pull_request:
4+
push:
45
branches:
56
- master
6-
push:
7+
pull_request:
78
branches:
89
- master
10+
11+
concurrency:
12+
# Skip intermediate builds: always.
13+
# Cancel intermediate builds: only if it is a pull request build.
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
16+
917
jobs:
1018
test:
1119
runs-on: ubuntu-latest
1220
strategy:
1321
matrix:
14-
group:
15-
- Core
1622
version:
1723
- '1'
1824
- '1.6'
1925
steps:
20-
- uses: actions/checkout@v2
26+
- uses: actions/checkout@v3
2127
- uses: julia-actions/setup-julia@v1
2228
with:
2329
version: ${{ matrix.version }}
24-
- uses: actions/cache@v1
25-
env:
26-
cache-name: cache-artifacts
27-
with:
28-
path: ~/.julia/artifacts
29-
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
30-
restore-keys: |
31-
${{ runner.os }}-test-${{ env.cache-name }}-
32-
${{ runner.os }}-test-
33-
${{ runner.os }}-
30+
- uses: julia-actions/cache@v1
3431
- uses: julia-actions/julia-buildpkg@v1
3532
- uses: julia-actions/julia-runtest@v1
3633
- uses: julia-actions/julia-processcoverage@v1
37-
- uses: codecov/codecov-action@v1
34+
- uses: codecov/codecov-action@v3
3835
with:
39-
file: lcov.info
36+
files: lcov.info

.github/workflows/FormatCheck.yml

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,40 +3,45 @@ name: format-check
33
on:
44
push:
55
branches:
6-
- 'master'
7-
- 'release-'
8-
tags: '*'
6+
- master
97
pull_request:
8+
branches:
9+
- master
10+
11+
concurrency:
12+
# Skip intermediate builds: always.
13+
# Cancel intermediate builds: only if it is a pull request build.
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
1016

1117
jobs:
1218
build:
13-
runs-on: ${{ matrix.os }}
14-
strategy:
15-
matrix:
16-
julia-version: [1]
17-
julia-arch: [x86]
18-
os: [ubuntu-latest]
19+
runs-on: ubuntu-latest
1920
steps:
20-
- uses: julia-actions/setup-julia@latest
21+
- uses: julia-actions/setup-julia@v1
2122
with:
22-
version: ${{ matrix.julia-version }}
23-
24-
- uses: actions/checkout@v1
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"))'
23+
version: '1'
24+
- uses: actions/checkout@v3
25+
- name: Install JuliaFormatter
26+
# This will use the latest version by default but you could set the version as well:
27+
# Pkg.add(; name="JuliaFormatter", version="1")
28+
run: |
29+
using Pkg
30+
Pkg.add(; name="JuliaFormatter")
31+
shell: julia --color=yes {0}
32+
- name: Run formatter
2933
run: |
30-
julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter"))'
31-
julia -e 'using JuliaFormatter; format(".", verbose=true)'
34+
using JuliaFormatter
35+
format("."; verbose=true)
36+
shell: julia --color=yes {0}
3237
- name: Format check
3338
run: |
34-
julia -e '
3539
out = Cmd(`git diff --name-only`) |> read |> String
3640
if out == ""
3741
exit(0)
3842
else
3943
@error "Some files have not been formatted !!!"
4044
write(stdout, out)
4145
exit(1)
42-
end'
46+
end
47+
shell: julia --color=yes {0}

.github/workflows/Invalidations.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Invalidations
2+
3+
on:
4+
pull_request:
5+
6+
concurrency:
7+
# Skip intermediate builds: always.
8+
# Cancel intermediate builds: always.
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
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@v1
20+
with:
21+
version: '1'
22+
- uses: actions/checkout@v3
23+
- uses: julia-actions/julia-buildpkg@v1
24+
- uses: julia-actions/julia-invalidations@v1
25+
id: invs_pr
26+
27+
- uses: actions/checkout@v3
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

.github/workflows/invalidations.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)