Skip to content

Commit 0ec14fa

Browse files
committed
Add a workflow Invalidations.yml
1 parent b019d00 commit 0ec14fa

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Invalidations
2+
# Uses SnoopCompile to evaluate number of invalidations caused by `using` the package
3+
# using https://github.com/julia-actions/julia-invalidations
4+
# Based on https://github.com/julia-actions/julia-invalidations
5+
6+
on:
7+
pull_request:
8+
9+
concurrency:
10+
# Skip intermediate builds: always.
11+
# Cancel intermediate builds: always.
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
evaluate:
17+
# Only run on PRs to the default branch.
18+
# In the PR trigger above branches can be specified only explicitly whereas this check should work for master, main, or any other default branch
19+
if: github.base_ref == github.event.repository.default_branch
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: julia-actions/setup-julia@v2
23+
with:
24+
version: '1.10'
25+
- uses: actions/checkout@v3
26+
- uses: julia-actions/julia-buildpkg@v1
27+
- uses: julia-actions/julia-invalidations@v1
28+
id: invs_pr
29+
30+
- uses: actions/checkout@v3
31+
with:
32+
ref: ${{ github.event.repository.default_branch }}
33+
- uses: julia-actions/julia-buildpkg@v1
34+
- uses: julia-actions/julia-invalidations@v1
35+
id: invs_default
36+
37+
- name: Report invalidation counts
38+
run: |
39+
echo "Invalidations on default branch: ${{ steps.invs_default.outputs.total }} (${{ steps.invs_default.outputs.deps }} via deps)" >> $GITHUB_STEP_SUMMARY
40+
echo "This branch: ${{ steps.invs_pr.outputs.total }} (${{ steps.invs_pr.outputs.deps }} via deps)" >> $GITHUB_STEP_SUMMARY
41+
- name: Check if the PR does increase number of invalidations
42+
if: steps.invs_pr.outputs.total > steps.invs_default.outputs.total
43+
run: exit 1

0 commit comments

Comments
 (0)