Repository navigation
104 lines (99 loc) · 2.91 KB
/
Copy pathci.yml
File metadata and controls
104 lines (99 loc) · 2.91 KB
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
name: CI
on:
push:
branches: [master]
pull_request:
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
backend:
name: Backend checks
runs-on: ubuntu-latest
services:
postgres:
image: postgres:17
env:
POSTGRES_PASSWORD: postgres
ports: ["5432:5432"]
options: >-
--health-cmd pg_isready --health-interval 5s --health-timeout 5s --health-retries 10
env:
MIX_ENV: test
DATABASE_PORT: "5432"
steps:
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
with:
version-file: .tool-versions
version-type: strict
- uses: actions/cache@v4
with:
path: |
deps
_build
key: mix-test-${{ runner.os }}-${{ hashFiles('.tool-versions') }}-${{ hashFiles('mix.lock') }}
restore-keys: mix-test-${{ runner.os }}-${{ hashFiles('.tool-versions') }}-
- run: mix deps.get
- run: mix check
frontend:
name: Frontend checks
runs-on: ubuntu-latest
defaults:
run:
working-directory: frontend
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .tool-versions
cache: npm
cache-dependency-path: frontend/package-lock.json
- run: npm ci --no-audit --no-fund
- run: npm run check
e2e:
name: Screen tests
runs-on: ubuntu-latest
env:
PICAPE_LOG_LEVEL: info
E2E_SKIP_SCREENSHOTS: "1"
E2E_BROWSER: chromium
steps:
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
with:
version-file: .tool-versions
version-type: strict
- uses: actions/setup-node@v4
with:
node-version-file: .tool-versions
cache: npm
cache-dependency-path: |
frontend/package-lock.json
e2e/package-lock.json
- uses: actions/cache@v4
with:
path: |
deps
_build
key: mix-dev-${{ runner.os }}-${{ hashFiles('.tool-versions') }}-${{ hashFiles('mix.lock') }}
restore-keys: mix-dev-${{ runner.os }}-${{ hashFiles('.tool-versions') }}-
- uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ hashFiles('e2e/package-lock.json') }}
restore-keys: playwright-${{ runner.os }}-
- run: sudo apt-get update && sudo apt-get install -y inotify-tools
- run: mix deps.get
- run: mix compile
- run: npm ci --no-audit --no-fund --prefix frontend
- run: npm ci --no-audit --no-fund --prefix e2e
- run: npx playwright install chromium
working-directory: e2e
- run: bin/e2e
- uses: actions/upload-artifact@v4
if: always()
with:
name: e2e-output
path: tmp/
if-no-files-found: ignore