-
Notifications
You must be signed in to change notification settings - Fork 9
65 lines (62 loc) · 1.84 KB
/
elixir_tests.yml
File metadata and controls
65 lines (62 loc) · 1.84 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
name: Elixir tests
on:
push:
branches: [master]
pull_request:
env:
MIX_ENV: test
jobs:
elixir-tests:
name: Elixir Tests
runs-on: ubuntu-20.04
timeout-minutes: 30
env:
DATABASE_HOST: localhost
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
services:
postgres:
image: postgres:13.1
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: database_test
PGDATA: /var/lib/postgresql/data/pgdata
ports:
- "5432:5432"
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: rokroskar/workflow-run-cleanup-action@v0.3.3
if: "github.ref != 'refs/heads/master'"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- name: Install system dependencies
run: |
sudo apt-get install -y imagemagick
- uses: actions/checkout@v2.4.0
- name: Copy config templates
working-directory: "config"
run: |
cp dev.local.exs.example dev.local.exs
cp test.local.exs.example test.local.exs
- name: Set up Elixir
uses: erlef/setup-elixir@v1.15.0
with:
elixir-version: "1.12.2" # Define the elixir version [required]
otp-version: "24.0" # Define the OTP version [required]
experimental-otp: true
- name: Restore deps cache
uses: actions/cache@v2.1.7
with:
path: |
**/_build
**/deps
key: ${{ runner.os }}-mix-${{ secrets.CACHE_VERSION }}-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-mix-${{ secrets.CACHE_VERSION }}
- name: Install dependencies
run: mix deps.get
- name: Run tests
run: mix test