-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (74 loc) · 2.34 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
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: Elixir CI
env:
MIX_ENV: test
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
actions: write
contents: read
jobs:
pre_job:
name: check for duplicate checkers
# continue-on-error: true # Uncomment once integration is finished
runs-on: ubuntu-latest
# Map a step output to a job output
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@v5
with:
paths_ignore: '["**.md", "docs/**"]'
cancel_others: true
build:
needs: pre_job
if: needs.pre_job.outputs.should_skip != 'true'
name: Build and test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- uses: DeterminateSystems/flake-checker-action@main
- name: Restore dependencies cache
uses: actions/cache@v4
with:
path: deps
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-mix-
- name: install mix
run: nix develop -c mix local.hex
- name: Run flakes check
run: |
nix flake check
nix develop -c echo OK
- name: Install dependencies
run: nix develop -c mix deps.get
# - name: Run Credo
# run: mix credo --strict
- name: Retrieve PLT Cache
uses: actions/cache@v4
id: plt-cache
with:
path: priv/plts
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-plts-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.*')) }}-${{ hashFiles(format('{0}{1}', github.workspace, '/flake.*')) }}
- name: Create PLTs
if: steps.plt-cache.outputs.cache-hit != 'true'
run: |
mkdir -p priv/plts
nix develop -c mix dialyzer --plt
- name: Run dialyzer
run: nix develop -c mix dialyzer --no-check --halt-exit-status
- name: Check Formatting
run: nix develop -c mix format --check-formatted
- name: Run tests
run: nix develop -c mix test
# - name: Build docs
# run: mix docs