-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (74 loc) · 2.33 KB
/
Copy pathelixir.yml
File metadata and controls
89 lines (74 loc) · 2.33 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
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: Elixir CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
contents: read
jobs:
build:
name: Build and test
runs-on: ubuntu-latest
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgres
# Provide the password for postgres
ports:
- 5432:5432
env:
POSTGRES_USER: ectotest
POSTGRES_PASSWORD: ectotest
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- name: Set up Elixir
uses: erlef/setup-beam@a23b1fc4452a892cf3e92cbc2c405256cd6c27ec
with:
elixir-version: '>=1.14' # Define the elixir version [required]
otp-version: '>=25' # Define the OTP version [required]
- name: Restore dependencies cache - mastery_persistence
uses: actions/cache@v4
with:
path: mastery_persistence/deps
key: ${{ runner.os }}-mixpersist-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-mixpersist-
- name: Install dependencies - mastery_persistence
run: mix deps.get
working-directory: mastery_persistence
- name: Create PostGres database
run: mix ecto.create
env:
MIX_ENV: test
working-directory: mastery_persistence
- name: Migrate PostGres database
run: mix ecto.migrate
env:
MIX_ENV: test
working-directory: mastery_persistence
- name: Run tests - mastery_persistence
run: mix test
working-directory: mastery_persistence
- name: Restore dependencies cache - mastery
uses: actions/cache@v4
with:
path: mastery/deps
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-mix-
- name: Install dependencies - mastery
run: mix deps.get
working-directory: mastery
- name: Run tests - mastery
run: mix test
working-directory: mastery