-
Notifications
You must be signed in to change notification settings - Fork 33
78 lines (75 loc) · 2.42 KB
/
e2e.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
name: E2E/Integration tests
on: [push]
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
jobs:
cypress:
runs-on: ubuntu-20.04 # Remember to update this when changing Erlang version. See https://github.com/erlef/setup-beam
services:
db:
image: captainfact/dev-db:latest
ports: ['5432:5432']
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
# Checkout
- name: Checkout API
uses: actions/checkout@v3
with:
repository: CaptainFact/captain-fact-api
ref: refs/heads/staging
path: api
- name: Checkout Frontend
uses: actions/checkout@v2
with:
repository: CaptainFact/captain-fact-frontend
path: frontend
# Setup API
- name: Restore Elixir cache
uses: actions/cache@v3
with:
path: ./api/deps
key: ${{ runner.os }}-mix-${{ env.cache-name }}-${{ hashFiles('**/mix.lock') }}
restore-keys: |
${{ runner.os }}-mix-${{ env.cache-name }}-
${{ runner.os }}-mix-
- name: Restore Elixir build folder
uses: actions/cache@v1
with:
path: ./api/build
key: ${{ runner.os }}-mix-${{ env.cache-name }}-${{ hashFiles('**/mix.lock') }}
restore-keys: |
${{ runner.os }}-mix-${{ env.cache-name }}-
${{ runner.os }}-mix-
- uses: erlef/setup-beam@v1
with:
version-file: ./api/.tool-versions
version-type: strict
- name: Install API's dependencies
working-directory: api
run: mix deps.get
- name: Compile dependencies
working-directory: api
run: mix deps.compile
- name: Compile project
working-directory: api
run: mix compile
- name: Prepare DB
working-directory: api
run: mix ecto.create && mix ecto.migrate
# Setup Frontend
- uses: actions/setup-node@v3
with:
node-version-file: './frontend/.tool-versions'
cache-dependency-path: './frontend/package-lock.json'
cache: 'npm'
- name: Install Frontend's dependencies
working-directory: frontend
run: npm ci --prefer-offline --no-audit
# Run tests
- name: Start E2E tests
working-directory: api
run: ./scripts/run_e2e_ci.sh