-
-
Notifications
You must be signed in to change notification settings - Fork 6
139 lines (113 loc) · 3.7 KB
/
ci.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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
group: ci-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
check:
name: Check
runs-on: ubuntu-latest
# runs-on: ${{ matrix.runner }}
# strategy:
# matrix:
# runner: [ubuntu-latest, self-hosted]
steps:
# - run: echo 'This job is running on ${{ matrix.runner }} runner!!'
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-and-cache
- name: Create .env
run: |
touch .env
echo DATABASE_URL=${{ secrets.DATABASE_URL }} >> .env
echo SOUND_DIR=${{ secrets.SOUND_DIR }} >> .env
echo AVATAR_DIR=${{ secrets.AVATAR_DIR }} >> .env
echo GOOGLE_PROJECT_ID=${{ secrets.GOOGLE_PROJECT_ID }} >> .env
echo GOOGLE_LOCATION=${{ secrets.GOOGLE_LOCATION }} >> .env
echo MICROSOFT_SPEECH_KEY=${{ secrets.MICROSOFT_SPEECH_KEY }} >> .env
echo DEEPL_AUTH_KEY=${{ secrets.DEEPL_AUTH_KEY }} >> .env
echo GMAIL_USER=${{ secrets.GMAIL_USER }} >> .env
echo GMAIL_PASS=${{ secrets.GMAIL_PASS }} >> .env
- name: Build
shell: bash
run: npm run build
- name: Lint Check
run: npm run lint
- name: Type Check
run: npm run typecheck
- name: Svelte Check
run: npm run check
tests:
name: Tests
runs-on: ubuntu-latest
timeout-minutes: 10
env:
DATABASE_URL: mysql://root:rootroot@127.0.0.1:3306/talk
services:
mysql:
image: mysql
ports:
- 3306:3306
env:
MYSQL_DATABASE: talk
MYSQL_ROOT_USER: root
MYSQL_ROOT_PASSWORD: rootroot
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
redis:
image: redis
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v3
- id: 'auth'
name: 'Authenticate to Google Cloud'
uses: 'google-github-actions/auth@v1'
with:
credentials_json: '${{ secrets.GOOGLE_CREDENTIALS }}'
- uses: ./.github/actions/setup-and-cache
- uses: ./.github/actions/prisma
# run: npx playwright install --with-deps
- name: Create .env
run: |
touch .env
echo DATABASE_URL=${{ secrets.DATABASE_URL }} >> .env
echo SOUND_DIR=${{ secrets.SOUND_DIR }} >> .env
echo AVATAR_DIR=${{ secrets.AVATAR_DIR }} >> .env
echo GOOGLE_PROJECT_ID=${{ secrets.GOOGLE_PROJECT_ID }} >> .env
echo GOOGLE_LOCATION=${{ secrets.GOOGLE_LOCATION }} >> .env
echo MICROSOFT_SPEECH_KEY=${{ secrets.MICROSOFT_SPEECH_KEY }} >> .env
echo DEEPL_AUTH_KEY=${{ secrets.DEEPL_AUTH_KEY }} >> .env
echo GMAIL_USER=${{ secrets.GMAIL_USER }} >> .env
echo GMAIL_PASS=${{ secrets.GMAIL_PASS }} >> .env
- name: Build
shell: bash
run: npm run build
- name: Vitest Test
run: npm run test:ci
# https://playwright.dev/docs/ci-intro
- name: Install Playwright Browsers
run: npx playwright install chromium
- name: Playwright Test
run: npm run test:e2e
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
- uses: actions/upload-artifact@v3
if: always()
with:
name: logs
path: logs/
retention-days: 30