-
Notifications
You must be signed in to change notification settings - Fork 0
132 lines (122 loc) · 4.01 KB
/
Copy pathelixir.yml
File metadata and controls
132 lines (122 loc) · 4.01 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: Build and Deploy to Docker Hub
on:
- push
- pull_request
- merge_group
jobs:
test:
name: Setup, Build, Test
runs-on: ubuntu-latest
if: ${{ github.repository_owner != 'brianmay' || github.event_name != 'pull_request' }}
# Service containers to run with `container-job`
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgis/postgis
ports: ["5432:5432"]
# Provide the password for postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: test
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
strategy:
matrix:
elixir: [1.20.0-rc.6]
otp: [29.0.1]
env:
DATABASE_URL_TEST: postgresql://postgres:postgres@localhost/test?sslmode=disable
MIX_ENV: test
BUILD_WITHOUT_QUIC: true
steps:
- uses: actions/checkout@v7
- name: Install system dependancies
run: |
sudo apt-get update --yes
sudo apt-get install --yes graphicsmagick-imagemagick-compat libimage-exiftool-perl ffmpeg exiftran libraw-bin
- name: Setup elixir
uses: erlef/setup-elixir@v1.24
with:
elixir-version: ${{ matrix.elixir }}
otp-version: ${{ matrix.otp }}
- name: Retrieve Mix Dependencies Cache
uses: actions/cache@v6
id: mix-cache # id to use in retrieve action
with:
path: deps
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles('mix.lock') }}
- name: Install Mix Dependencies
if: ${{ steps.mix-cache.outputs.cache-hit != 'true' }}
run: |
mix local.rebar --force
mix local.hex --force
mix deps.get
- name: Build
run: |
mix compile
- name: Build NPM assets
run: |
npm install --prefix assets
npm run deploy --prefix assets
- name: Check Formatting
run: mix format --check-formatted
- name: Run Credo
run: mix credo --strict
- name: Download and extract test data
run: |
wget https://www.dropbox.com/s/yg6jdk9lfewn8yf/penguin_memories.tar?dl=0 -O test_data.tar
echo "1be2094961977dc393b7312b8799259b2026b4570c4591bc6759dbfbfb0fe146 test_data.tar" | sha256sum --check
tar -xvf test_data.tar
- name: Run Tests
run: mix test
dialyzer:
runs-on: ubuntu-latest
if: ${{ github.repository_owner != 'brianmay' || github.event_name != 'pull_request' }}
strategy:
matrix:
elixir: [1.20.0-rc.6]
otp: [29.0.1]
env:
MIX_ENV: test
BUILD_WITHOUT_QUIC: true
steps:
- uses: actions/checkout@v7
- name: Setup elixir
uses: erlef/setup-elixir@v1.24
with:
elixir-version: ${{ matrix.elixir }}
otp-version: ${{ matrix.otp }}
- name: Retrieve Mix Dependencies Cache
uses: actions/cache@v6
id: mix-cache # id to use in retrieve action
with:
path: deps
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles('mix.lock') }}
- name: Retrieve PLT Cache
uses: actions/cache@v6
id: plt-cache
with:
path: priv/plts
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-plts-${{ hashFiles('mix.lock') }}-5
- name: Install Mix Dependencies
if: ${{ steps.mix-cache.outputs.cache-hit != 'true' }}
run: |
mix local.rebar --force
mix local.hex --force
mix deps.get
- name: Build
run: |
mix compile
- name: Create PLTs
if: ${{ steps.plt-cache.outputs.cache-hit != 'true' }}
run: |
mkdir -p priv/plts
mix dialyzer --plt
- name: Run dialyzer
run: mix dialyzer --no-check