|
1 | | -# Integration test in --dev mode |
2 | | -# https://cryptousetech.atlassian.net/wiki/spaces/CI/pages/2586411104/Integration+tests |
3 | | -name: yarn-dev |
4 | | - |
5 | | -# Triger: only call from main workflow(re-usable workflows) |
6 | | -on: |
7 | | - workflow_call: |
8 | | - workflow_dispatch: |
9 | | - |
10 | | -# A workflow run is made up of one or more jobs that can run sequentially or in parallel |
11 | | -jobs: |
12 | | - |
13 | | - dev_build_int_tests: |
14 | | - # The type of runner that the job will run on |
15 | | - runs-on: [ ci ] |
16 | | - timeout-minutes: 1380 |
17 | | - |
18 | | - name: ${{ matrix.network }} |
19 | | - |
20 | | - 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. |
21 | | - |
22 | | - strategy: |
23 | | - matrix: |
24 | | - include: |
25 | | - - network: "opal" |
26 | | - - network: "quartz" |
27 | | - - network: "unique" |
28 | | - |
29 | | - steps: |
30 | | - - name: Clean Workspace |
31 | | - uses: AutoModality/action-clean@v1.1.0 |
32 | | - |
33 | | - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it |
34 | | - - uses: actions/checkout@v4.1.7 |
35 | | - with: |
36 | | - ref: ${{ github.head_ref }} #Checking out head commit |
37 | | - |
38 | | - - name: Read .env file |
39 | | - uses: xom9ikk/dotenv@v2.3.0 |
40 | | - |
41 | | - - name: Generate ENV related extend file for docker-compose |
42 | | - uses: cuchi/jinja2-action@v1.2.0 |
43 | | - with: |
44 | | - template: .docker/docker-compose.tmp-dev.j2 |
45 | | - output_file: .docker/docker-compose.${{ matrix.network }}.yml |
46 | | - variables: | |
47 | | - NETWORK=${{ matrix.network }} |
48 | | - |
49 | | - - name: Show build configuration |
50 | | - run: cat .docker/docker-compose.${{ matrix.network }}.yml |
51 | | - |
52 | | - - name: Build the stack |
53 | | - run: docker compose -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --remove-orphans |
54 | | - |
55 | | - - uses: actions/setup-node@v4.0.2 |
56 | | - with: |
57 | | - node-version: 20 |
58 | | - |
59 | | - - name: Run tests |
60 | | - working-directory: js-packages/tests |
61 | | - run: | |
62 | | - yarn install |
63 | | - yarn add mochawesome |
64 | | - ../scripts/wait_for_first_block.sh |
65 | | - echo "Ready to start tests" |
66 | | - NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW} |
67 | | - env: |
68 | | - RPC_URL: http://127.0.0.1:9944/ |
69 | | - |
70 | | - - name: Test Report |
71 | | - uses: phoenix-actions/test-reporting@v15 |
72 | | - id: test-report |
73 | | - if: success() || failure() # run this step even if previous step failed |
74 | | - with: |
75 | | - name: int test results - ${{ matrix.network }} # Name of the check run which will be created |
76 | | - path: js-packages/tests/mochawesome-report/test-*.json # Path to test results |
77 | | - reporter: mochawesome-json |
78 | | - fail-on-error: 'false' |
79 | | - |
80 | | - - name: Read output variables |
81 | | - run: | |
82 | | - echo "url is ${{ steps.test-report.outputs.runHtmlUrl }}" |
83 | | -
|
84 | | - - name: Run benchmark mintFee tests |
85 | | - working-directory: js-packages/scripts |
86 | | - run: | |
87 | | - yarn install |
88 | | - node --no-warnings=ExperimentalWarning --loader ts-node/esm ./benchmarks/mintFee/index.ts |
89 | | -
|
90 | | - - name: Run benchmark opsFee tests |
91 | | - working-directory: js-packages/scripts |
92 | | - run: | |
93 | | - yarn install |
94 | | - node --no-warnings=ExperimentalWarning --loader ts-node/esm ./benchmarks/opsFee/index.ts |
95 | | -
|
96 | | - - name: Stop running containers |
97 | | - if: always() # run this step always |
98 | | - run: docker compose -f ".docker/docker-compose.${{ matrix.network }}.yml" down |
99 | | - |
100 | | - - name: Remove builder cache |
101 | | - if: always() # run this step always |
102 | | - run: | |
103 | | - docker builder prune -f -a |
104 | | - docker system prune -f |
105 | | - docker image prune -f -a |
106 | | -
|
107 | | - # check: |
108 | | - # if: always() |
109 | | - # runs-on: [ ci ] |
110 | | - # needs: |
111 | | - # - dev_build_int_tests |
112 | | - |
113 | | - # steps: |
114 | | - # - name: Install python3 |
115 | | - # uses: actions/setup-python@v4 |
116 | | - # with: |
117 | | - # python-version: '3.10' |
118 | | - |
119 | | - # - name: Decide whether the needed jobs succeeded or failed |
120 | | - # uses: re-actors/alls-green@v1.2.2 |
121 | | - # with: |
122 | | - # jobs: ${{ toJSON(needs) }} |
0 commit comments