-
Notifications
You must be signed in to change notification settings - Fork 5
57 lines (50 loc) · 1.41 KB
/
elixir-build-and-test.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
name: Build and Test
on:
push:
branches:
- main
pull_request:
branches:
- "*"
jobs:
build:
strategy:
matrix:
elixir-version: ["1.15.8", "1.16.2", "1.17.3"]
otp-version: ["25.3.2", "26.2.5", "27.1.2"]
name: Build and test
runs-on: ubuntu-latest
env:
MIX_ENV: test
# Remove if you don't need a database
services:
db:
image: "postgres:15.3-alpine"
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: ecto_resource_test
ports: ["5432:5432"]
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Elixir Project
uses: ./.github/actions/elixir-setup
with:
elixir-version: ${{ matrix.elixir-version }}
otp-version: ${{ matrix.otp-version }}
build-flags: --all-warnings --warnings-as-errors
build-app: true
- name: Run Migrations
run: mix ecto.migrate
# Run tests & migrations even if compilation failed (probably due to warnings)
# so that we give devs as much feedback as possible & save some time.
if: always()
- name: Run Tests
run: mix test --warnings-as-errors
if: always()