-
Notifications
You must be signed in to change notification settings - Fork 2
92 lines (76 loc) · 2.2 KB
/
elixir.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
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
name: Elixir CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
MIX_ENV: test
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
elixir: [1.13.4, 1.14.2]
otp: [24.3.4, 25.2.0]
name: Build and test
steps:
- uses: actions/checkout@v3
- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
elixir-version: ${{ matrix.elixir }} # Define the elixir version [required]
otp-version: ${{ matrix.otp }} # Define the OTP version [required]
- name: Restore dependencies cache
uses: actions/cache@v3
id: mix-cache
with:
path: deps
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- name: Restore build cache
id: build-cache
uses: actions/cache@v1
with:
path: _build
key: cache-${{ runner.os }}-dialyzer_build-${{ matrix.otp }}-${{ matrix.elixir }}-${{ 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: Compile
if: steps.build-cache.outputs.cache-hit != 'true'
env:
MIX_ENV: test
run: mix deps.compile; mix compile --force --warnings-as-errors
- name: Check Formatting
run: mix format --check-formatted
- name: Run Credo
run: mix credo --strict
- name: Run tests
run: mix test
- name: Run coverage tool
run: mix coveralls.github
- name: Build docs
uses: lee-dohm/generate-elixir-docs@v1
- name: upload artifact
uses: actions/upload-artifact@v2
with:
name: public${{ matrix.build }}
path: public
deploy:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/download-artifact@v2
with:
path: artifacts
- name: Publish to Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./doc