-
Notifications
You must be signed in to change notification settings - Fork 22
87 lines (78 loc) · 2.82 KB
/
Copy pathpr-workflow.yaml
File metadata and controls
87 lines (78 loc) · 2.82 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
83
84
85
86
87
on: [pull_request]
name: mabl
jobs:
test:
name: Mabl Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
- uses: actions/setup-node@v6
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Run checks
run: pnpm run check
- name: Run Tests
run: pnpm test
- name: Compile Typescript
run: pnpm run build
- name: Run mabl tests (no-wait)
id: mabl-test-no-wait
uses: ./
env:
MABL_API_KEY: ${{ secrets.MABL_API_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
application-id: D6uz-lhAGBYuTTc6Jj_w0Q-a
environment-id: I9tfo2dWd7WSigXcO91feA-e
app-url: 'https://storage.googleapis.com/public-test-pages/uptime/canary.html'
await-completion: false
plan-labels: |
canary
- name: Validate no-wait outputs
run: |
if [ -z "${{ steps.mabl-test-no-wait.outputs.mabl-deployment-id }}" ]; then
echo "::error::mabl-deployment-id should be set when await-completion=false"
exit 1
fi
if [ -n "${{ steps.mabl-test-no-wait.outputs.plans_run }}" ]; then
echo "::error::plans_run should NOT be set when await-completion=false"
exit 1
fi
- name: Run mabl tests against deployment
id: mabl-test-deployment
uses: ./
env:
MABL_API_KEY: ${{ secrets.MABL_API_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
application-id: D6uz-lhAGBYuTTc6Jj_w0Q-a
environment-id: I9tfo2dWd7WSigXcO91feA-e
# Intentionally trigger deprecation warning
uri: 'https://sandbox.mabl.com'
app-url: 'https://storage.googleapis.com/public-test-pages/uptime/canary.html'
browser-types: |
chrome
plan-labels: |
canary
smoke-test
http-headers: |
X-Test-Header-1: 1234
X-Test-Header-2: 5678
- name: Validate wait outputs
run: |
if [ -z "${{ steps.mabl-test-deployment.outputs.mabl-deployment-id }}" ]; then
echo "::error::mabl-deployment-id should be set when await-completion=true"
exit 1
fi
if [ -z "${{ steps.mabl-test-deployment.outputs.plans_run }}" ]; then
echo "::error::plans_run should be set when await-completion=true"
exit 1
fi
if [ -z "${{ steps.mabl-test-deployment.outputs.tests_run }}" ]; then
echo "::error::tests_run should be set when await-completion=true"
exit 1
fi