-
Notifications
You must be signed in to change notification settings - Fork 2
51 lines (43 loc) · 1.07 KB
/
build-and-test.yaml
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
name: Build and Test
on:
push:
branches:
- main
pull_request:
branches:
- "*"
# Cancel any in-progress instances of this workflow when this instance is triggered.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-and-test:
name: Build and Test
runs-on: ubuntu-latest
env:
MIX_ENV: test
services:
db:
image: postgres:16
ports: ["5432:5432"]
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Elixir Project
uses: ./.github/actions/elixir-setup
with:
build-flags: --all-warnings --warnings-as-errors
- name: Run Migrations
run: mix ecto.create; mix ecto.migrate
if: always()
- name: Run Tests
run: mix test
if: always()