Repository navigation
79 lines (75 loc) · 2.44 KB
/
Copy pathci.yml
File metadata and controls
79 lines (75 loc) · 2.44 KB
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
name: CI
on:
push:
branches: [main]
pull_request:
schedule:
# Nightly live run against TestingBot production.
- cron: '17 3 * * *'
workflow_dispatch:
inputs:
suite:
description: Live suites to run
type: choice
options: [all, web, mobile]
default: all
permissions:
contents: read
jobs:
test:
name: Unit tests (Node ${{ matrix.node }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: ['22', '24']
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: ${{ matrix.node }}
cache: npm
- run: npm ci
# The examples import the package by name, which resolves to dist/.
- run: npm run build
- run: npm run typecheck
- run: npm test
- name: Check the package contents
run: npm pack --dry-run
live:
name: Live (TestingBot production)
needs: test
# Forks and pull requests get no secrets; the job runs where they exist.
if: github.event_name != 'pull_request'
runs-on: macos-latest
timeout-minutes: 60
# Live runs share the account's parallel sessions: never two at once.
concurrency:
group: testingbot-live
cancel-in-progress: false
env:
TESTINGBOT_KEY: ${{ secrets.TESTINGBOT_KEY }}
TESTINGBOT_SECRET: ${{ secrets.TESTINGBOT_SECRET }}
steps:
- name: Skip without TestingBot credentials
if: env.TESTINGBOT_KEY == '' || env.TESTINGBOT_SECRET == ''
run: echo "::notice::Set the TESTINGBOT_KEY and TESTINGBOT_SECRET repository secrets to run the live tests."
- uses: actions/checkout@v7
if: env.TESTINGBOT_KEY != '' && env.TESTINGBOT_SECRET != ''
- uses: actions/setup-node@v7
if: env.TESTINGBOT_KEY != '' && env.TESTINGBOT_SECRET != ''
with:
node-version: '24'
cache: npm
- if: env.TESTINGBOT_KEY != '' && env.TESTINGBOT_SECRET != ''
run: npm ci && npm run build
- name: Run the live harness
if: env.TESTINGBOT_KEY != '' && env.TESTINGBOT_SECRET != ''
run: npm run test:live -- ${{ (github.event.inputs.suite == 'web' && '--web') || (github.event.inputs.suite == 'mobile' && '--mobile') || '' }}
- name: Keep the traces
if: failure()
uses: actions/upload-artifact@v7
with:
name: e2e-results
path: e2e-results/
if-no-files-found: ignore