-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (64 loc) · 2.63 KB
/
Copy pathci.yml
File metadata and controls
75 lines (64 loc) · 2.63 KB
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
71
72
73
74
75
name: CI
on:
push:
branches: [master]
pull_request:
workflow_dispatch:
# A second push to the same branch makes the first run's answer stale, and a real-tmux suite is too
# expensive to keep running for an answer nobody will read.
# Cancel a superseded run only on a pull request, where a new push genuinely replaces the answer.
# On master every commit's run stands on its own: grouping them all together meant re-running an
# older commit cancelled the newest one, which is the opposite of what a green history needs.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name == 'pull_request' && github.ref || github.sha }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions:
contents: read
jobs:
check:
name: check (JDK ${{ matrix.java }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# 21 is the baseline the library compiles against; the newest LTS is here because a library
# is run on JDKs its author never chose, and the ones that break it break at runtime.
java: ['21', '25']
steps:
- uses: actions/checkout@v7
- name: Install tmux
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends -y tmux
tmux -V
- uses: actions/setup-java@v5
with:
distribution: temurin
java-version: ${{ matrix.java }}
- uses: gradle/actions/setup-gradle@v6
with:
# The wrapper jar is a binary this repository executes, so its checksum is verified against
# the ones Gradle published rather than trusted because it is committed here.
validate-wrappers: true
- run: ./gradlew check --stacktrace
# A real-tmux suite that leaves servers running would be invisible here and expensive on a
# developer's machine. The runner is discarded either way, so this is the only place the
# question gets asked for free.
- name: No tmux server outlived the suite
if: always()
run: |
left="$(pgrep -c tmux || true)"
if [ "${left:-0}" -ne 0 ]; then
echo "::error::$left tmux server(s) survived the suite"
for p in $(pgrep tmux); do tr '\0' ' ' < "/proc/$p/cmdline"; echo; done
exit 1
fi
echo "no tmux server survived the suite"
- name: Publish to a local repository
run: ./gradlew publishToMavenLocal --stacktrace
- uses: actions/upload-artifact@v7
if: failure()
with:
name: reports-jdk${{ matrix.java }}
path: '**/build/reports/**'
retention-days: 7