-
-
Notifications
You must be signed in to change notification settings - Fork 122
57 lines (51 loc) · 1.84 KB
/
Invalidations.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Invalidations
on:
pull_request:
paths:
- 'src/**'
- 'lib/**'
concurrency:
# Skip intermediate builds: always.
# Cancel intermediate builds: always.
group: ${{ github.workflow }}-${{ github.ref }}
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'
# current branch
- uses: actions/checkout@v4
- name: add MPIPreferences
shell: julia --color=yes --project=. {0}
run: |
using Pkg
Pkg.develop(path="lib/MPIPreferences")
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-invalidations@v1
id: invs_pr
# default branch
- uses: actions/checkout@v4
with:
ref: ${{ github.event.repository.default_branch }}
- name: add MPIPreferences
shell: julia --color=yes --project=. {0}
run: |
using Pkg
Pkg.develop(path="lib/MPIPreferences")
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-invalidations@v1
id: invs_default
# report
- 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