Skip to content

Commit 490fe94

Browse files
authored
ci: Migrate deserializer CI from Drone to GHA (#513)
1 parent 4c7fbd0 commit 490fe94

14 files changed

+94
-154
lines changed

.drone-consider

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
11
.drone.yml
2-
packages/sdk/.drone.yml
3-
packages/dataprotector-deserializer/.drone.yml
4-
packages/sharing-smart-contract/.drone.yml
5-
packages/smart-contract/.drone.yml

.drone.yml

Lines changed: 1 addition & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ steps:
3333
echo "ABIs not up-to-date in packages/subgraph, need to run 'npm run refresh-abis'"
3434
exit 1
3535
fi
36-
36+
3737
---
3838
# pipeline to upgrade the DataProtectorSharing SC
3939
kind: pipeline
@@ -125,54 +125,6 @@ steps:
125125
---
126126
kind: pipeline
127127
type: docker
128-
name: publish dataprotector-subgraph-deployer docker image
129-
130-
trigger:
131-
event:
132-
- promote
133-
target:
134-
# publish a dataprotector-subgraph-deployer docker image dev
135-
- subgraph-deployer-docker-dev
136-
# publish a dataprotector-subgraph-deployer docker image prod
137-
- subgraph-deployer-docker-prod
138-
branch:
139-
- main
140-
141-
steps:
142-
- name: set-prod-tag-from-package
143-
image: node:18.19
144-
# generates the .tags file for the docker plugin
145-
commands:
146-
- cd packages/subgraph
147-
- npm pkg get version | sed 's/"//g' > ../../.tags
148-
when:
149-
target:
150-
- subgraph-deployer-docker-prod
151-
152-
- name: set-dev-tag
153-
image: node:18.19
154-
# generates the .tags file for the docker plugin
155-
commands:
156-
- echo "dev-$DRONE_COMMIT" > .tags
157-
when:
158-
target:
159-
- subgraph-deployer-docker-dev
160-
161-
- name: docker-publish
162-
image: plugins/docker
163-
pull: always
164-
settings:
165-
context: .
166-
dockerfile: packages/subgraph/deployer.Dockerfile
167-
repo: iexechub/dataprotector-subgraph-deployer
168-
pull_image: true
169-
username:
170-
from_secret: dockerhub-user
171-
password:
172-
from_secret: dockerhub-password
173-
---
174-
kind: pipeline
175-
type: docker
176128
name: sdk deprecate npm version
177129

178130
trigger:

.github/workflows/core-smart-contract-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ on:
1717
concurrency:
1818
group: ${{ github.ref }}-core-smart-contract-ci
1919
cancel-in-progress: true
20-
20+
2121
jobs:
2222
build-and-test:
2323
runs-on: ubuntu-latest

.github/workflows/core-smart-contract-deploy.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Smart Contract Deploy
1+
name: Core Smart Contract - Deploy
22

33
on:
44
workflow_dispatch: # Manual trigger
@@ -58,7 +58,6 @@ jobs:
5858
run: |
5959
NETWORK="${{ inputs.network }}"
6060
ENVIRONMENT="${{ inputs.environment }}"
61-
6261
case "$NETWORK" in
6362
arbitrum|bellecour)
6463
if [ "$ENVIRONMENT" = "dev" ]; then
@@ -102,7 +101,7 @@ jobs:
102101
commit_user_name: 'GitHub Actions Bot'
103102
commit_user_email: 'github-actions[bot]@users.noreply.github.com'
104103
commit_author: 'GitHub Actions Bot <github-actions[bot]@users.noreply.github.com>'
105-
104+
106105
- name: Verify contract
107106
if: inputs.network != 'hardhat'
108107
continue-on-error: true
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Deserializer - Default
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- '*'
7+
paths:
8+
- 'packages/dataprotector-deserializer/**'
9+
concurrency:
10+
group: ${{ github.ref }}-deserializer-ci
11+
cancel-in-progress: true
12+
13+
jobs:
14+
build-and-test:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- uses: actions/setup-node@v4
20+
with:
21+
node-version: 18
22+
cache: 'npm'
23+
cache-dependency-path: packages/dataprotector-deserializer/package-lock.json
24+
25+
- name: Build test dependencies in SDK package
26+
working-directory: packages/sdk
27+
run: |
28+
npm ci
29+
npm run codegen
30+
npm run build
31+
32+
- name: Install dependencies
33+
working-directory: packages/dataprotector-deserializer
34+
run: |
35+
npm ci
36+
npm run test:prepare
37+
38+
- name: Check format
39+
working-directory: packages/dataprotector-deserializer
40+
run: npm run check-format
41+
42+
- name: Lint
43+
working-directory: packages/dataprotector-deserializer
44+
run: npm run lint
45+
46+
- name: Check types
47+
working-directory: packages/dataprotector-deserializer
48+
run: npm run check-types
49+
50+
- name: Test
51+
working-directory: packages/dataprotector-deserializer
52+
run: npm run test
53+
54+
- name: Build
55+
working-directory: packages/dataprotector-deserializer
56+
run: npm run build
57+
58+
publish-dry-run:
59+
runs-on: ubuntu-latest
60+
needs: build-and-test
61+
steps:
62+
- uses: actions/checkout@v4
63+
64+
- uses: actions/setup-node@v4
65+
with:
66+
node-version: 18
67+
cache: 'npm'
68+
cache-dependency-path: packages/dataprotector-deserializer/package-lock.json
69+
70+
- name: Install dependencies
71+
working-directory: packages/dataprotector-deserializer
72+
run: npm ci
73+
74+
- name: Build
75+
working-directory: packages/dataprotector-deserializer
76+
run: npm run build
77+
78+
- name: NPM publish dry-run
79+
working-directory: packages/dataprotector-deserializer
80+
run: npm publish --dry-run

.github/workflows/publish-npm-deserializer.yml renamed to .github/workflows/deserializer-publish-npm.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Publish Package NPM - dataprotector-deserializer
1+
name: Deserializer - Publish NPM Package
22

33
on:
44
workflow_dispatch:

.github/workflows/sdk-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: dataprotector SDK - CI
1+
name: SDK - Default
22

33
on:
44
pull_request:

.github/workflows/publish-npm-sdk-latest.yml renamed to .github/workflows/sdk-publish-npm-latest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: npm publish latest - dataprotector
1+
name: SDK - Publish NPM latest
22
description: Publish on npm when a release is published
33

44
on:

.github/workflows/publish-npm-sdk-staging.yml renamed to .github/workflows/sdk-publish-npm-staging.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: npm publish staging - dataprotector
1+
name: SDK - Publish NPM staging
22
description: Publish a staging version on npm
33

44
on:

.github/workflows/sharing-smart-contract-deploy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Sharing Smart Contract - Deployment
1+
name: Sharing Smart Contract - Deploy
22

33
on:
44
workflow_dispatch: # Manual trigger
@@ -101,7 +101,7 @@ jobs:
101101
DEPLOYMENT_ID="$DEPLOYMENT_ID" \
102102
npm run deploy -- --network ${{ inputs.network }}
103103
fi
104-
104+
105105
- name: Save deployment artifacts
106106
if: inputs.network != 'hardhat'
107107
uses: stefanzweifel/git-auto-commit-action@v5

0 commit comments

Comments
 (0)