-
Notifications
You must be signed in to change notification settings - Fork 71
95 lines (75 loc) · 2.56 KB
/
integration-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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: Integration tests
on:
pull_request:
workflow_dispatch:
inputs:
url:
description: 'API URL to test'
required: true
default: https://stacks-node-api.testnet.stacks.co
jobs:
test-integration:
runs-on: ${{ matrix.os }}
env:
STX_NETWORK: ${{ matrix.stx_network }}
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
DEFAULT_TESTNET_STACKS_NODE_URL: ${{ github.event.inputs.name }}
strategy:
matrix:
os: [macos-11, ubuntu-20.04]
stx_network: [testnet, mainnet]
steps:
- name: Check out Git repository
uses: actions/checkout@v2
- uses: actions/cache@v2
id: cache-node-modules
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/package.json') }}
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Add required Linux dependencies
uses: ./.github/actions/linux-deps
if: matrix.os == 'ubuntu-20.04'
- uses: actions/setup-python@v5
if: matrix.os == 'macos-11'
with:
python-version: '3.10'
- name: Install packages
uses: nick-invision/retry@v2
if: steps.cache-node-modules.outputs.cache-hit != 'true'
with:
timeout_seconds: 600
max_attempts: 5
retry_on: error
command: yarn --frozen-lockfile
- uses: microsoft/playwright-github-action@v1
- name: Install electron-prebuilt
uses: nick-invision/retry@v2
with:
timeout_seconds: 300
max_attempts: 5
retry_on: error
command: yarn add electron-prebuilt --ignore-scripts
- run: ls -R node_modules/electron
- run: cd node_modules/electron && sudo node install.js
- run: ls -R node_modules/electron
- name: Build assets
run: ./node_modules/.bin/cross-env yarn build
env:
NODE_ENV: production
SHA: ${{ github.event.pull_request.head.sha }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
- run: yarn test:integration
if: matrix.os == 'macos-11'
- run: xvfb-run --auto-servernum -- yarn test:integration
if: matrix.os == 'ubuntu-20.04'
- uses: actions/upload-artifact@v2
if: always()
with:
name: test-screenshots-${{ matrix.os }}-${{ matrix.stx_network }}-${{ steps.date.outputs.date }}
path: screenshots