-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (64 loc) · 1.92 KB
/
ci.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
58
59
60
61
62
63
64
65
66
67
68
69
70
name: CI
on: [push, pull_request]
jobs:
skip_check:
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
run_ci_matrix:
needs: skip_check
if: ${{ needs.skip_check.outputs.should_skip != 'true' }}
runs-on: ubuntu-latest
strategy:
matrix:
java-version: [ 11, 17, 21 ] # Note: earliest supported JVM version is 11
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ matrix.java-version }}
- uses: DeLaGuardo/[email protected]
with:
cli: latest
- uses: actions/cache@v4
with:
path: |
~/.m2/repository
~/.gitlibs
~/.clojure
~/.cpcache
key: ${{ runner.os }}-${{ hashFiles('**/deps.edn') }}
- name: Continuous integration
run: clojure -Srepro -J-Dclojure.main.report=stderr -T:build ci
# Adapted from https://brunoscheufler.com/blog/2022-04-09-the-required-github-status-check-that-wasnt
after_ci_matrix:
needs: run_ci_matrix
runs-on: ubuntu-latest
if: success()
outputs:
success: ${{ steps.setoutput.outputs.success }}
steps:
- id: setoutput
run: echo "::set-output name=success::true"
CI:
runs-on: ubuntu-latest
if: always()
needs: [skip_check, run_ci_matrix, after_ci_matrix]
steps:
- run: |
skipped="${{ needs.skip_check.outputs.should_skip }}"
passed="${{ needs.after_ci_matrix.outputs.success }}"
if [[ $skipped == "true" ]]; then
echo "CI matrix skipped"
exit 0
elif [[ $passed == "true" ]]; then
echo "CI matrix passed"
exit 0
else
echo "CI matrix failed"
exit 1
fi