-
Notifications
You must be signed in to change notification settings - Fork 5
50 lines (42 loc) · 1.69 KB
/
component-tests_template.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
name: Playwright Component Tests - Template
on:
deployment_status
permissions:
# contents: write
pull-requests: write
jobs:
update-base-snapshots:
name: Keep Base Component Snapshots In Sync with Main Branch
if: github.event.deployment_status.state == 'success' && github.event.deployment_status.environment == 'Production – kitbook-template'
runs-on: ubuntu-latest
timeout-minutes: 15
container:
image: mcr.microsoft.com/playwright:v1.39.0-jammy # https://playwright.dev/docs/ci#github-actions-via-containers - keep version in sync with installed package
steps:
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8.6.0
- name: Install Dependencies
run: pnpm install
- name: Run Playwright Component tests
run: pnpm build && pnpm -F template test:components
env:
CI: true
PLAYWRIGHT_BASE_URL: ${{ github.event.deployment_status.target_url }}
- name: Wipe base clean
- uses: actions-hub/gcloud@master
env:
PROJECT_ID: components-check
APPLICATION_CREDENTIALS: ${{ secrets.GCS_COMPONENT_CHECK_BUCKETS_CREDENTIALS }}
with:
args: storage rm gs://component-snapshots/kitbook-template/main/** --verbosity=critical # set verbosity to ignore errors emitted when nothing is found to delete
- name: Upload base images
- uses: actions-hub/gcloud@master
env:
PROJECT_ID: components-check
with:
args: storage cp --recursive ./packages/template/e2e/snapshots gs://component-snapshots/kitbook-template/main/**