Repository navigation
142 lines (129 loc) · 4.27 KB
/
Copy pathplugins-verify.yml
File metadata and controls
142 lines (129 loc) · 4.27 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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
name: Plugin SDKs
# The plugin contract, developer guides and official SDKs live in
# shared/plugins next to the Rust Core that executes the contract, so every
# change is tested against Core at the same commit. Only changes that can
# affect them start this workflow.
on:
pull_request:
paths:
- 'shared/plugins/**'
- 'rust/**'
- '.github/workflows/plugins-verify.yml'
push:
branches: [main]
paths:
- 'shared/plugins/**'
- 'rust/**'
- '.github/workflows/plugins-verify.yml'
workflow_dispatch:
permissions:
contents: read
concurrency:
group: plugins-verify-${{ github.ref }}
cancel-in-progress: true
jobs:
docs:
name: Contract and docs
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v6
with:
node-version: 22
- name: Test the tooling
run: node --test shared/plugins/scripts/*.test.mjs
- name: Check schema IDs and links
run: node shared/plugins/scripts/verify-docs.mjs
sdk-node:
name: Node.js SDK
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v7
# The SDK supports Node.js 20.3 and newer, so it is tested on the oldest
# supported major.
- uses: actions/setup-node@v6
with:
node-version: 20
- name: Test
run: node --test shared/plugins/sdk/node/test/*.test.mjs
- name: Check TypeScript consumers
run: |
npm ci --prefix shared/plugins/sdk/node --ignore-scripts --no-audit --no-fund
npm run --prefix shared/plugins/sdk/node test:types
sdk-java:
name: Java SDK
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v7
# The SDK supports Java 8: the tests run on a Java 8 runtime, while
# Maven builds with the newer JDK set up last.
- name: Set up Java 8 runtime
id: java8
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: '8'
- name: Set up Java 21 for Maven
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: '21'
- name: Build and test on Java 8
env:
JAVA8: ${{ steps.java8.outputs.path }}/bin/java
run: mvn -B -ntp -f shared/plugins/sdk/java/pom.xml verify -Djvm="$JAVA8"
sdk-rust:
name: Rust SDK
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v7
# The SDK supports Rust 1.87 and newer: the tests run on that release,
# and formatting and lints on the current stable toolchain.
- uses: dtolnay/rust-toolchain@1.87
- name: Test on the oldest supported Rust
run: cargo +1.87 test --locked --manifest-path shared/plugins/sdk/rust/Cargo.toml
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- name: Check formatting and lints
run: |
cargo fmt --manifest-path shared/plugins/sdk/rust/Cargo.toml --all -- --check
cargo clippy --locked --manifest-path shared/plugins/sdk/rust/Cargo.toml --all-targets -- -D warnings
sdk-e2e:
name: SDK end-to-end with Rust Core
runs-on: ubuntu-latest
timeout-minutes: 40
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v6
with:
node-version: 20
- name: Set up Java 8 runtime
id: java8
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: '8'
- name: Set up Java 21 for Maven
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: '21'
- uses: dtolnay/rust-toolchain@stable
- uses: actions/cache@v6
with:
path: |
~/.cargo/registry
~/.cargo/git
rust/target
shared/plugins/sdk/rust/target
key: sdk-e2e-${{ runner.os }}-${{ hashFiles('rust/Cargo.lock', 'shared/plugins/sdk/rust/Cargo.lock') }}
restore-keys: sdk-e2e-${{ runner.os }}-
- name: Run the SDK scenarios against this Core
env:
LITHE_PLUGIN_SDK_JAVA_RUNTIME: ${{ steps.java8.outputs.path }}/bin/java
run: node shared/plugins/scripts/sdk-e2e.mjs