-
Notifications
You must be signed in to change notification settings - Fork 28
163 lines (144 loc) · 4.65 KB
/
test-node-candidate.yml
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
name: Test latest node release candidate
on:
workflow_dispatch:
inputs:
docker-image-tag-name:
type: string
description: The tag of the kiltprotocol/standalone-node Docker image to test against
required: true
env:
TESTCONTAINERS_WATCHER_IMG: testcontainers/ryuk:0.3.2
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- name: yarn install
run: yarn install --immutable
- name: yarn build
run: yarn build
- name: zip build
run: zip -r build.zip .
- name: upload build
uses: actions/upload-artifact@v4
with:
name: build
path: build.zip
cache_imgs:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
- name: make sure testcontainers image is in cache
uses: ./.github/actions/cached-image-pull
with:
image: ${{ env.TESTCONTAINERS_WATCHER_IMG }}
integration_test:
runs-on: ubuntu-latest
needs: cache_imgs
steps:
- uses: actions/download-artifact@v4
with:
name: build
- name: unzip
run: unzip build.zip -d .
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: Log out node version
run: node --version
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-central-1
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
- name: pull image
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: dh/kiltprotocol/standalone-node
IMAGE_TAG: ${{ github.event.inputs.docker-image-tag-name }}
run: |
docker pull $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
echo "TESTCONTAINERS_NODE_IMG=$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" >> $GITHUB_ENV
- name: get cached testcontainers image
uses: ./.github/actions/cached-image-pull
with:
image: ${{ env.TESTCONTAINERS_WATCHER_IMG }}
- name: run integration tests
timeout-minutes: 60
run: yarn test:integration -b
bundle_cache:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/download-artifact@v4
with:
name: build
- name: unzip
run: unzip build.zip -d .
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: yarn bundle
run: yarn bundle
- name: upload bundle artifact
uses: actions/upload-artifact@v4
with:
name: checked-nonmin-bundle
path: packages/sdk-js/dist/sdk-js.umd.js
bundle_test:
runs-on: ubuntu-latest
needs: [cache_imgs, bundle_cache]
steps:
- uses: actions/download-artifact@v4
with:
name: build
- name: unzip
run: unzip build.zip -d .
- uses: actions/download-artifact@v4
with:
name: checked-nonmin-bundle
path: packages/sdk-js/dist
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- run: basename /packages/sdk-js/dist/
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-central-1
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
- name: pull node image
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: dh/kiltprotocol/standalone-node
IMAGE_TAG: ${{ github.event.inputs.docker-image-tag-name }}
run: |
docker pull $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
echo "TESTCONTAINERS_NODE_IMG=$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" >> $GITHUB_ENV
- name: get cached testcontainers image
uses: ./.github/actions/cached-image-pull
with:
image: ${{ env.TESTCONTAINERS_WATCHER_IMG }}
- name: prepare bundle tests
run: |
yarn test:ci:bundle:preparation
- name: run bundle tests
timeout-minutes: 60
run: |
yarn test:bundle