-
Notifications
You must be signed in to change notification settings - Fork 103
82 lines (73 loc) · 2.51 KB
/
Copy pathtest.yml
File metadata and controls
82 lines (73 loc) · 2.51 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
80
81
82
name: Build and Test
run-name: Build and Test
on:
workflow_call:
inputs:
command:
description: 'npm scripts command to execute'
type: string
required: true
command_description:
description: 'Description of the npm scripts command to execute'
type: string
required: true
needs_playwright:
description: 'Whether or not to install playwright'
type: boolean
default: false
needs_lfs:
description: 'Whether or not to checkout with LFS'
type: boolean
default: false
should_run:
description: 'Whether or not to execute the command'
type: boolean
default: true
jobs:
build-and-test:
name: ${{ inputs.command_description }}
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: ⏭️ Skip ${{ inputs.command_description }}
if: inputs.should_run == false
run: echo "No relevant changes detected; skipping ${{ inputs.command_description }}."
- name: ⬇️ Checkout
if: inputs.should_run
uses: actions/checkout@v4
with:
lfs: ${{ inputs.needs_lfs }}
- name: ⎔ Setup node
if: inputs.should_run
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
- name: 🏗 Install Dependencies
if: inputs.should_run
run: npm ci
- name: 🏗 Install Playwright
if: inputs.should_run && inputs.needs_playwright == true
run: npx playwright install --with-deps
- name: 🔑 Setup SSH for private submodule
if: inputs.should_run
run: |
if [ -z "$SUBMODULE_SSH_KEY" ]; then
echo "Skipping SSH setup; SUBMODULE_SSH_KEY is not available"
exit 0
fi
mkdir -p ~/.ssh
echo -e "${SUBMODULE_SSH_KEY//_/\\n}" > ~/.ssh/id_rsa
chmod og-rwx ~/.ssh/id_rsa
env:
SUBMODULE_SSH_KEY: ${{ secrets.SUBMODULE_SSH_KEY }}
- name: ▶️ ${{ inputs.command_description }}
if: inputs.should_run
run: ${{ inputs.command }}
env:
BETTER_AUTH_SECRET: ${{ secrets.AUTH_SECRET || 'ci-build-placeholder-secret' }}
- name: ⬆️ Upload Visual Regression Test Results
uses: actions/upload-artifact@v4
if: ${{ failure() && inputs.should_run && inputs.command_description == 'Visual Regression Tests' }}
with:
name: visual-regression-test-results
path: packages/stacks-classic/screenshots