-
Notifications
You must be signed in to change notification settings - Fork 1
106 lines (90 loc) · 2.99 KB
/
ci.yml
File metadata and controls
106 lines (90 loc) · 2.99 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
name: CI
on: pull_request
permissions:
contents: read
issues: read
checks: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: Test
runs-on: ubuntu-latest
container: hexpm/elixir:1.18.3-erlang-27.3.3-debian-bookworm-20250407-slim
steps:
- name: Install Tools
run: apt update && apt install --no-install-recommends --yes build-essential git
- name: Checkout
uses: actions/checkout@v5
- name: Fetch Hex Cache
uses: actions/cache@v4
id: hex-cache
with:
path: |
deps
_build
key: ${{ runner.os }}-mix-${{ hashFiles('mix.lock') }}
restore-keys: |
${{ runner.os }}-mix-
- name: Run Tests
run: |
mix local.hex --force
mix local.rebar --force
git config --global --add safe.directory '*'
mix deps.get
MIX_ENV=test mix compile --warnings-as-errors
mix test
- name: Publish Results
uses: mikepenz/action-junit-report@v6
if: ${{ failure() }}
with:
check_name: Test Results
report_paths: _build/test/lib/together/*.xml
style:
name: Style
runs-on: ubuntu-latest
container: hexpm/elixir:1.18.3-erlang-27.3.3-debian-bookworm-20250407-slim
steps:
- name: Install Tools
run: apt update && apt install --no-install-recommends --yes build-essential git
- name: Checkout
uses: actions/checkout@v5
- name: Fetch Hex Cache
uses: actions/cache/restore@v4
id: hex-cache
with:
path: |
deps
_build
key: ${{ runner.os }}-mix-${{ hashFiles('mix.lock') }}
restore-keys: |
${{ runner.os }}-mix-
- name: Fetch PLT Cache
uses: actions/cache@v4
with:
key: ${{ runner.os }}-plt-${{ hashFiles('mix.lock') }}
restore-keys: |
${{ runner.os }}-plt-
path: |
priv/plts
- name: Install
run: |
mix local.hex --force
mix local.rebar --force
git config --global --add safe.directory '*'
mix deps.get
- name: Check Unused Dependencies
run: mix deps.unlock --check-unused
- name: Check Formatting
run: mix format --check-formatted
if: always()
- name: Check Credo
run: mix credo
if: always()
- name: Run Dialyzer
# Two formats are included for ease of debugging and it is lightly recommended to use both, see https://github.com/jeremyjh/dialyxir/issues/530 for reasoning
# --format github is helpful to print the warnings in a way that GitHub understands and can place on the /files page of a PR
# --format dialyxir allows the raw GitHub actions logs to be useful because they have the full warning printed
run: mix dialyzer --format github --format dialyxir
if: always()