Repository navigation
80 lines (70 loc) · 3.15 KB
/
Copy pathjava-agent.yml
File metadata and controls
80 lines (70 loc) · 3.15 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
76
77
78
79
80
name: Java Agent
on:
# Fail-open filter: skip only pull requests whose changes stay entirely
# inside the standalone keploy-junit5/ Maven module (tested by
# junit5-sdk.yml). Any change to keploy-sdk/, root pom.xml, scripts/,
# workflows, or any new top-level path still runs the full matrix on every
# pull request regardless of target branch, and every push to main runs
# unfiltered.
pull_request:
paths-ignore:
- "keploy-junit5/**"
push:
branches: [main]
# Superseded runs are pointless work: a push to a PR branch makes the
# previous run's result irrelevant. Matters more now that the trigger above
# is unfiltered and this repo carries a lot of long-lived branches.
concurrency:
group: java-agent-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
verify:
name: JDK ${{ matrix.java-version }}
runs-on: ubuntu-latest
# A hung step would otherwise hold its runner for GitHub's default of
# 6 hours. The full matrix (including forked Jetty 9.4/11/12.0/12.1 and
# Undertow 2.3 honesty suites plus the 180 s smoke test) runs ~7-10 minutes
# on 4 CPUs and up to ~12 minutes with additional forked suites, so 20
# minutes gives headroom without letting a truly stuck job linger.
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
java-version: ["8", "11", "17", "21"]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: ${{ matrix.java-version }}
cache: maven
- name: Build
# With the release profile, signing skipped (CI holds no release
# key), as release.yml builds the jars it deploys.
run: mvn -B -P release -Dgpg.skip -DskipTests clean verify
- name: Record keploy-sdk's jars
# The main jar and the sources jar. The javadoc jar is left out:
# every build makes it anew, with the time in its pages.
shell: bash
run: |
jars=$(ls keploy-sdk/target/keploy-sdk-*.jar | grep -v -e '-javadoc\.jar$')
sha256sum $jars | tee "$RUNNER_TEMP/keploy-sdk-jars.sha256"
- name: Unit tests
run: mvn -B -pl keploy-sdk -am test
- name: Smoke test Java agent
run: ./scripts/smoke-javaagent.sh
- name: A build without clean leaves keploy-sdk's jars as they were
# release.yml smoke-tests the jar of its clean build, then deploys to
# Maven Central from a second pass over the same target/, with the
# release profile and no clean. That pass must leave the bytes of the
# jar and of the sources jar as they were (shade writes the jar anew
# on every pass; only its bytes must stay), or Central gets jars
# other than the ones built and tested. The unit tests above stop at
# the test phase, but what they change in target/classes would reach
# the jar in this pass, so they are checked too.
shell: bash
run: |
mvn -B -P release -Dgpg.skip -DskipTests verify
sha256sum -c "$RUNNER_TEMP/keploy-sdk-jars.sha256"