-
-
Notifications
You must be signed in to change notification settings - Fork 377
86 lines (71 loc) · 2.15 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
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
linting:
name: Linting
runs-on: ubuntu-latest
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Check linting rules
run: yarn lint
- name: Check types
run: yarn lint:tsc
# Label of the container job
integration-tests:
name: Run tests
# Containers must run in Linux based operating systems
runs-on: ubuntu-latest
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
steps:
# Downloads a copy of the code in your repository before running CI tests
- name: Check out repository code
uses: actions/checkout@v3
- name: Install system dependencies
run: |
sudo apt-get update
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn
- name: Set environment variables
run: |
echo "DATABASE_URL=postgresql://postgres:password@localhost:5432/rallly" >> $GITHUB_ENV
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Run db
run: |
docker pull postgres:14.2
docker run -d -p 5432:5432 -e POSTGRES_PASSWORD=password -e POSTGRES_DB=rallly postgres:14.2
yarn wait-on --timeout 60000 tcp:localhost:5432
- name: Deploy migrations
run: yarn db:deploy
- name: Install playwright dependencies
run: yarn playwright install --with-deps chromium
- name: Run tests
run: yarn test
- name: Upload artifact playwright-report
if: ${{ success() || failure() }}
uses: actions/upload-artifact@v3
with:
name: playwright-report
path: ./apps/web/playwright-report