-
Notifications
You must be signed in to change notification settings - Fork 27
172 lines (144 loc) · 4.83 KB
/
tests-polkadot-deps.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
164
165
166
167
168
169
170
171
172
name: Compatible with latest dependencies
on:
schedule:
- cron: 59 23 * * SAT
env:
TESTCONTAINERS_WATCHER_IMG: testcontainers/ryuk:0.3.2
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x]
steps:
- uses: actions/checkout@v3
with:
ref: master
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- name: delete yarn.lock
run: rm -f yarn.lock
- name: run yarn install
run: yarn install
env:
YARN_ENABLE_IMMUTABLE_INSTALLS: false
- name: list dependencies
run: echo "$(yarn info -A --name-only --json)" > locked_dependencies.txt
- name: upload dependencies list
uses: actions/upload-artifact@v3
with:
name: deps-${{ matrix.node-version }}
path: |
locked_dependencies.txt
yarn.lock
- name: yarn build
run: yarn build
- name: zip build
run: zip -r build.zip .
- name: upload build
uses: actions/upload-artifact@v3
with:
name: build-${{ matrix.node-version }}
path: build.zip
test:
runs-on: ubuntu-latest
needs: build
strategy:
matrix:
node-version: [18.x, 20.x]
required: ['required']
include:
- node-version: 16.x
required: 'optional'
continue-on-error: ${{ matrix.required == 'optional' }}
steps:
- uses: actions/download-artifact@v3
with:
name: build-${{ matrix.node-version }}
- name: unzip
run: unzip build.zip -d .
- name: unit tests
run: yarn test:ci
integration_test:
runs-on: ubuntu-latest
needs: build
strategy:
matrix:
image: ['latest']
required: ['required']
include:
- image: 'latest-master'
required: 'optional'
continue-on-error: ${{ matrix.required == 'optional' }}
steps:
- uses: actions/download-artifact@v3
with:
name: build-20.x
- name: unzip
run: unzip build.zip -d .
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
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@v1
- name: pull image
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: kilt/prototype-chain
IMAGE_TAG: ${{ matrix.image }}
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 (cjs)
timeout-minutes: 60
run: yarn test:integration -b
- name: run integration tests (esm)
timeout-minutes: 60
run: yarn test:integration:esm -b
create-issue:
runs-on: ubuntu-latest
needs: [test, integration_test]
if: failure()
steps:
- uses: actions/download-artifact@v3
with:
name: deps-20.x
- name: set dependencies env
run: |
echo 'DEPS<<EOF' >> $GITHUB_ENV
cat locked_dependencies.txt >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- name: Set date env
run: |
echo "TODAY=$(date '+%Y-%m-%d')" >> $GITHUB_ENV
- name: issue-bot
uses: imjohnbo/issue-bot@v3
with:
labels: 'bug, incompatible dependencies, automation'
pinned: false
close-previous: true
linked-comments: true
title: SDK no longer compatible with latest dependencies
body: |-
## Incompatibilities detected
A [scheduled test workflow](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) using the latest available dependencies matching our semver ranges has failed.
We may need to constrain dependency ranges in our `package.json` or introduce fixes to recover compatibility.
Below you can find a summary of dependency versions against which these tests were run.
_Note: This issue was **automatically created** as a result of scheduled CI tests on ${{env.TODAY}}._
<details>
<summary>Dependency versions</summary>
${{env.DEPS}}
</details>
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}