-
Notifications
You must be signed in to change notification settings - Fork 15
116 lines (94 loc) · 3.75 KB
/
governance.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
# Governance tests in --dev mode with gov-test-timings feature enabled to reduce gov timings
name: governance
# 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:
prepare-execution-marix:
name: Prepare execution matrix
runs-on: [ ci ]
outputs:
matrix: ${{ steps.create_matrix.outputs.matrix }}
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: Create Execution matrix
uses: CertainLach/create-matrix-action@v4
id: create_matrix
with:
matrix: |
network {unique}
network {quartz}
network {opal}
dev_build_int_tests:
needs: prepare-execution-marix
# The type of runner that the job will run on
runs-on: [ ci ]
timeout-minutes: 1380
name: ${{ matrix.network }}
strategy:
matrix:
include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}}
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.
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.gov.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 testGovernance --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: 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