-
Notifications
You must be signed in to change notification settings - Fork 11
112 lines (100 loc) · 3.98 KB
/
test-zitadel-oauth.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: Test Zitadel OAuth
on:
pull_request:
branches: [main]
push:
branches: [main]
workflow_dispatch:
jobs:
test-google-oauth:
runs-on: ubuntu-latest
env:
##########################################################################
# App Config
##########################################################################
NEXT_PUBLIC_URL: "http://localhost:3000"
DATABASE_URI: "file:./payload-oauth2.db"
PAYLOAD_SECRET: "hellohereisasecretforyou"
##########################################################################
# Google OAuth Config
##########################################################################
GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }}
GOOGLE_CLIENT_SECRET: ${{ secrets.GOOGLE_CLIENT_SECRET }}
##########################################################################
# Test Config
##########################################################################
# Optional: Set to "true" to run test browser in headless mode
HEADLESS: true
##########################################################################
# Google Test Account
##########################################################################
# Required: Google Test Account Email
GOOGLE_TEST_EMAIL: ${{ secrets.GOOGLE_TEST_EMAIL }}
# Required: Google Test Account Password
GOOGLE_TEST_PASSWORD: ${{ secrets.GOOGLE_TEST_PASSWORD }}
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: "pnpm"
- run: |
pnpx puppeteer browsers install chrome
- run: pnpm install
- run: pnpm test:google
test-zitadel-oauth:
runs-on: ubuntu-latest
env:
##########################################################################
# App Config
##########################################################################
NEXT_PUBLIC_URL: "http://localhost:3000"
DATABASE_URI: "file:./payload-oauth2.db"
PAYLOAD_SECRET: "hellohereisasecretforyou"
##########################################################################
# Zitadel OAuth Config
##########################################################################
ZITADEL_CLIENT_ID: ${{ secrets.ZITADEL_CLIENT_ID }}
ZITADEL_CLIENT_SECRET: ${{ secrets.ZITADEL_CLIENT_SECRET }}
ZITADEL_TOKEN_ENDPOINT: ${{ secrets.ZITADEL_TOKEN_ENDPOINT }}
ZITADEL_AUTHORIZATION_URL: ${{ secrets.ZITADEL_AUTHORIZATION_URL }}
ZITADEL_USERINFO_ENDPOINT: ${{ secrets.ZITADEL_USERINFO_ENDPOINT }}
##########################################################################
# Test Config
##########################################################################
# Optional: Set to "true" to run test browser in headless mode
HEADLESS: true
##########################################################################
# Zitadel Test Account
##########################################################################
# Required: Zitadel Test Account Email
ZITADEL_TEST_EMAIL: ${{ secrets.ZITADEL_TEST_EMAIL }}
# Required: Zitadel Test Account Password
ZITADEL_TEST_PASSWORD: ${{ secrets.ZITADEL_TEST_PASSWORD }}
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: "pnpm"
- run: |
pnpx puppeteer browsers install chrome
- run: pnpm install
- name: Run test
run: |
for i in {1..3}; do
echo "Attempt $i"
if pnpm test:zitadel; then
echo "Success on attempt $i"
exit 0
fi
echo "Attempt $i failed, retrying..."
done
echo "All attempts failed"
exit 1