71 lines (68 loc) · 1.86 KB
/
_tests.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
name: Unlock Test Suite
on:
workflow_call:
inputs:
# pass none to run all tests
changed:
description: 'The services/apps that changed (JSON array stringified)'
type: string
required: false
default: '[
"locksmith",
"packages/contracts",
"packages/hardhat-plugin",
"packages/unlock-js",
"packages/paywall",
"smart-contracts",
"governance",
"subgraph",
"unlock-protocol-com",
"wedlocks",
"unlock-app",
"packages/core"
]'
jobs:
unit-tests:
name: Unit Tests ${{ matrix.target }}
runs-on: ubuntu-22.04
if: ${{ inputs.changed != '[]' }}
env:
DOCKER_BUILDKIT: 1
BUILDKIT_PROGRESS: plain
BUILDKIT_STEP_LOG_MAX_SIZE: 50000000
# below env vars are just used by locksmith
DB_USERNAME: locksmith_test
DB_PASSWORD: password
DB_NAME: locksmith_test
DB_HOSTNAME: db
strategy:
matrix:
target: ${{fromJson( inputs.changed )}}
steps:
- uses: actions/checkout@v4
- name: Running ${{ matrix.target }} tests
run: ./scripts/tests.sh ${{ matrix.target }}
shell: bash
integration-tests:
name: Integration Tests
runs-on: ubuntu-22.04
env:
DOCKER_BUILDKIT: 1
BUILDKIT_PROGRESS: plain
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Prepare repo
run: yarn && yarn build
- name: Run Integration Tests
run: scripts/integration-tests.sh
- name: Archive production artifacts
uses: actions/upload-artifact@v4
with:
name: screenshots
path: /tmp/screenshots
- name: Log failing tests
if: ${{ failure() }}
run: ./scripts/docker-compose-log.sh