-
Notifications
You must be signed in to change notification settings - Fork 13
81 lines (81 loc) · 2.84 KB
/
test-web.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
name: Playwright Tests
run-name: ${{ github.actor }} is testing out GitHub Actions 🚀
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
jobs:
test:
timeout-minutes: 60
runs-on: self-hosted
environment: upwithcrowd
env:
TEST_PASSWORD: ${{ secrets.TEST_PASSWORD }}
TEST_USERNAME: ${{ secrets.TEST_USERNAME }}
AUTH_TRUST_HOST: ${{ secrets.TRUST_HOST }}
AUTH_SECRET: ${{ secrets.AUTH_SECRET }}
NEXTAUTH_SECRET: ${{ secrets.NEXTAUTH_SECRET }}
APPLICATION_NAME: ${{ vars.APPLICATION_NAME }}
BASE_URL: ${{ secrets.BASE_URL }}
PRIMARY_COLOR: ${{ vars.PRIMARY_COLOR }}
steps:
# - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
# - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
# - run: echo "🎉 The secret user is ${{ secrets.TEST_USERNAME }}"
# - name: Make envfile
# uses: SpicyPizza/create-envfile@v2.0.3
# with:
# directory: "apps/web"
# file_name: .env
# fail_on_empty: true
# sort_keys: false
# envkey_TEST_USERNAME: ${{ secrets.TEST_USERNAME }}
# envkey_APPLICATION_NAME: ${{ vars.APPLICATION_NAME }}
# envkey_PRIMARY_COLOR: ${{ vars.PRIMARY_COLOR }}
# - name: show .env file
# run: |
# cd .\apps\web
# cat .env
# - uses: actions/checkout@v4
# with:
# submodules: true
# - uses: actions/setup-node@v4
# with:
# node-version: 20
# cache: 'pnpm'
# - name: Install dependencies
# run: |
# npm install -g pnpm
# pnpm install
# - name: Install Playwright Browsers
# run: pnpm exec playwright install --with-deps
# - name: Make envfile
# uses: SpicyPizza/create-envfile@v2.0.3
# with:
# directory: "apps/web"
# file_name: .env
# fail_on_empty: true
# sort_keys: false
# envkey_TEST_PASSWORD: ${{ secrets.TEST_PASSWORD }}
# envkey_TEST_USERNAME: ${{ secrets.TEST_USERNAME }}
# envkey_AUTH_TRUST_HOST: ${{ secrets.TRUST_HOST }}
# envkey_AUTH_SECRET: ${{ secrets.AUTH_SECRET }}
# envkey_NEXTAUTH_SECRET: ${{ secrets.NEXTAUTH_SECRET }}
# envkey_APPLICATION_NAME: ${{ vars.APPLICATION_NAME }}
# envkey_BASE_URL: ${{ secrets.BASE_URL }}
# envkey_PRIMARY_COLOR: ${{ vars.PRIMARY_COLOR }}
# - name: build web app
# run: pnpm run build:web
- name: Start web app and wait for it to be ready
run: pnpm run start:web
- name: Run Playwright tests
run: |
cd .\apps\web
pnpm exec playwright test
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: apps/web/playwright-report/
retention-days: 30