Skip to content

Commit d5dcf91

Browse files
PierreJeanjacquotzguesmiLe-Caignec
authored
ci: migrate sdk CI to GHA (#459)
* ci: migrate sdk CI to GHA * ci: split CI jobs * fix: inverted step names Co-authored-by: Zied Guesmi <[email protected]> * chore: remove useless env Co-authored-by: Robin Le Caignec <[email protected]> * ci: cache deps * refactor: chain codegen with install * ci: trigger sdk tests when subgraph is modified to ensure backward compatibility --------- Co-authored-by: Zied Guesmi <[email protected]> Co-authored-by: Robin Le Caignec <[email protected]>
1 parent 54796d5 commit d5dcf91

File tree

4 files changed

+115
-424
lines changed

4 files changed

+115
-424
lines changed

.github/workflows/sdk-ci.yml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: dataprotector SDK - CI
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- '*'
7+
paths:
8+
- 'packages/sdk/**'
9+
# also trigger sdk tests when subgraph is modified to ensure backward compatibility
10+
- 'packages/subgraph/**'
11+
12+
concurrency:
13+
group: ${{ github.ref }}-sdk-ci
14+
cancel-in-progress: true
15+
16+
jobs:
17+
check-code:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- uses: actions/setup-node@v4
23+
with:
24+
node-version: 18
25+
cache: 'npm'
26+
cache-dependency-path: packages/sdk/package-lock.json
27+
28+
- name: Install Dependencies
29+
working-directory: packages/sdk
30+
run: npm ci && npm run codegen
31+
32+
- name: Lint
33+
working-directory: packages/sdk
34+
run: npm run lint
35+
36+
- name: Check formatting
37+
working-directory: packages/sdk
38+
run: npm run check-format
39+
40+
- name: Check types
41+
working-directory: packages/sdk
42+
run: npm run check-types
43+
44+
test:
45+
runs-on: ubuntu-latest
46+
steps:
47+
- uses: actions/checkout@v4
48+
49+
- uses: actions/setup-node@v4
50+
with:
51+
node-version: 18
52+
cache: 'npm'
53+
cache-dependency-path: packages/sdk/package-lock.json
54+
55+
- name: Install Dependencies
56+
working-directory: packages/sdk
57+
run: npm ci && npm run codegen
58+
59+
- name: Test unit
60+
working-directory: packages/sdk
61+
run: npm run test:unit
62+
63+
- name: Start e2e test stack
64+
working-directory: packages/sdk
65+
run: npm run start-test-stack
66+
67+
- name: Test e2e
68+
working-directory: packages/sdk
69+
run: npm run test:e2e
70+
71+
- name: Stop e2e test stack
72+
working-directory: packages/sdk
73+
if: always()
74+
run: npm run stop-test-stack
75+
76+
build:
77+
runs-on: ubuntu-latest
78+
steps:
79+
- uses: actions/checkout@v4
80+
81+
- uses: actions/setup-node@v4
82+
with:
83+
node-version: 18
84+
cache: 'npm'
85+
cache-dependency-path: packages/sdk/package-lock.json
86+
87+
- name: Install Dependencies
88+
working-directory: packages/sdk
89+
run: npm ci && npm run codegen
90+
91+
- name: Build
92+
working-directory: packages/sdk
93+
run: npm run build
94+
95+
- name: publish dry-run
96+
working-directory: packages/sdk
97+
run: npm publish --dry-run

0 commit comments

Comments
 (0)