-
Notifications
You must be signed in to change notification settings - Fork 14
122 lines (99 loc) · 3.95 KB
/
yarn-dev.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
# Integration test in --dev mode
# https://cryptousetech.atlassian.net/wiki/spaces/CI/pages/2586411104/Integration+tests
name: yarn-dev
# Triger: only call from main workflow(re-usable workflows)
on:
workflow_call:
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
dev_build_int_tests:
# The type of runner that the job will run on
runs-on: [ self-hosted-ci,medium ]
timeout-minutes: 1380
name: ${{ matrix.network }}
continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false.
strategy:
matrix:
include:
- network: "opal"
- network: "quartz"
- network: "unique"
steps:
- name: Clean Workspace
uses: AutoModality/[email protected]
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/[email protected]
with:
ref: ${{ github.head_ref }} #Checking out head commit
- name: Read .env file
uses: xom9ikk/[email protected]
- name: Generate ENV related extend file for docker-compose
uses: cuchi/[email protected]
with:
template: .docker/docker-compose.tmp-dev.j2
output_file: .docker/docker-compose.${{ matrix.network }}.yml
variables: |
NETWORK=${{ matrix.network }}
- name: Show build configuration
run: cat .docker/docker-compose.${{ matrix.network }}.yml
- name: Build the stack
run: docker compose -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --remove-orphans
- uses: actions/[email protected]
with:
node-version: 20
- name: Run tests
working-directory: js-packages/tests
run: |
yarn install
yarn add mochawesome
../scripts/wait_for_first_block.sh
echo "Ready to start tests"
NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW}
env:
RPC_URL: http://127.0.0.1:9944/
- name: Test Report
uses: phoenix-actions/test-reporting@v15
id: test-report
if: success() || failure() # run this step even if previous step failed
with:
name: int test results - ${{ matrix.network }} # Name of the check run which will be created
path: js-packages/tests/mochawesome-report/test-*.json # Path to test results
reporter: mochawesome-json
fail-on-error: 'false'
- name: Read output variables
run: |
echo "url is ${{ steps.test-report.outputs.runHtmlUrl }}"
- name: Run benchmark mintFee tests
working-directory: js-packages/scripts
run: |
yarn install
node --no-warnings=ExperimentalWarning --loader ts-node/esm ./benchmarks/mintFee/index.ts
- name: Run benchmark opsFee tests
working-directory: js-packages/scripts
run: |
yarn install
node --no-warnings=ExperimentalWarning --loader ts-node/esm ./benchmarks/opsFee/index.ts
- name: Stop running containers
if: always() # run this step always
run: docker compose -f ".docker/docker-compose.${{ matrix.network }}.yml" down
- name: Remove builder cache
if: always() # run this step always
run: |
docker builder prune -f -a
docker system prune -f
docker image prune -f -a
# check:
# if: always()
# runs-on: [self-hosted-ci]
# needs:
# - dev_build_int_tests
# steps:
# - name: Install python3
# uses: actions/setup-python@v4
# with:
# python-version: '3.10'
# - name: Decide whether the needed jobs succeeded or failed
# uses: re-actors/[email protected]
# with:
# jobs: ${{ toJSON(needs) }}