Repository navigation
120 lines (114 loc) · 3.71 KB
/
Copy pathci.yml
File metadata and controls
120 lines (114 loc) · 3.71 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
unit:
name: unit (${{ matrix.runner }})
strategy:
fail-fast: false
matrix:
runner: [ubuntu-24.04, macos-15, windows-2025]
runs-on: ${{ matrix.runner }}
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "21"
cache: maven
- run: ./mvnw -B -ntp spotless:check
shell: bash
- run: ./mvnw -B -ntp test
shell: bash
- run: ./mvnw -B -ntp verify
shell: bash
- name: Build and run a clean external consumer
shell: bash
run: |
set -euo pipefail
repository="${RUNNER_TEMP}/consumer-m2"
consumer="${RUNNER_TEMP}/consumer-app"
cp -R examples/consumer "$consumer"
./mvnw -B -ntp -Drevision=0.15.0-SNAPSHOT -Dmaven.repo.local="$repository" install
./mvnw -B -ntp -Dmaven.repo.local="$repository" \
-Dtx3.sdk.version=0.15.0-SNAPSHOT \
-f "$consumer/pom.xml" verify exec:java
- name: Record dependency tree
shell: bash
run: ./mvnw -B -ntp dependency:tree -DoutputFile=target/dependency-tree.txt
- name: Inspect package contents
shell: bash
run: |
set -euo pipefail
jar tf target/tx3-sdk-0.15.0.jar | tee target/package-contents.txt
grep -qx 'META-INF/LICENSE' target/package-contents.txt
grep -qx 'land/tx3/sdk/Tx3Client.class' target/package-contents.txt
- uses: actions/upload-artifact@v4
with:
name: package-evidence-${{ matrix.runner }}
path: |
target/tx3-sdk-0.15.0.jar
target/package-contents.txt
target/dependency-tree.txt
e2e:
name: live TRP e2e
runs-on: ubuntu-24.04
timeout-minutes: 20
env:
CI: "true"
TRP_ENDPOINT_PREPROD: ${{ secrets.TRP_ENDPOINT_PREPROD }}
TRP_API_KEY_PREPROD: ${{ secrets.TRP_API_KEY_PREPROD }}
TEST_PARTY_A_ADDRESS: ${{ secrets.TEST_PARTY_A_ADDRESS }}
TEST_PARTY_A_MNEMONIC: ${{ secrets.TEST_PARTY_A_MNEMONIC }}
TEST_PARTY_B_ADDRESS: ${{ secrets.TEST_PARTY_B_ADDRESS }}
TEST_PARTY_B_MNEMONIC: ${{ secrets.TEST_PARTY_B_MNEMONIC }}
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "21"
cache: maven
- name: Require canonical e2e configuration
shell: bash
run: |
set -euo pipefail
for name in TRP_ENDPOINT_PREPROD TRP_API_KEY_PREPROD TEST_PARTY_A_ADDRESS TEST_PARTY_A_MNEMONIC TEST_PARTY_B_ADDRESS TEST_PARTY_B_MNEMONIC; do
if [ -z "${!name:-}" ]; then
echo "Missing required e2e configuration: $name" >&2
exit 1
fi
done
- run: ./mvnw -B -ntp -Pe2e verify
codegen:
name: generated Java client
runs-on: ubuntu-24.04
timeout-minutes: 25
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "21"
cache: maven
- name: Setup tx3 toolchain
uses: tx3-lang/actions/setup@v1
- name: Render, smoke-check, and compile the generated client
env:
CODEGEN_M2_REPO: ${{ runner.temp }}/codegen-m2
run: bash .github/scripts/codegen-check.sh