Repository navigation
74 lines (64 loc) · 2.86 KB
/
Copy pathjava-agent.yml
File metadata and controls
74 lines (64 loc) · 2.86 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
name: Java Agent
on:
# Deliberately unfiltered: the Woodpecker pipeline this replaced ran the
# matrix on every pull request regardless of target, and this repo has
# several long-lived integration branches that would otherwise get no CI.
pull_request:
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 steps below take about 2 minutes on 4 CPUs with an empty
# Maven cache, and the smoke stops its own Tomcat case after 180 s, so a
# run that reaches 10 minutes is stuck, not slow.
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
java-version: ["8", "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"