-
Notifications
You must be signed in to change notification settings - Fork 3
159 lines (130 loc) · 4.17 KB
/
ci.yml
File metadata and controls
159 lines (130 loc) · 4.17 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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
name: Automatic testing
on: [push]
concurrency:
group: ${{ github.ref }}
cancel-in-progress: ${{ github.ref != format('refs/heads/{0}', github.event.repository.default_branch || 'master') }}
env:
ERL_FLAGS: "-enable-feature maybe_expr"
jobs:
commit-message:
name: Check commit messages
runs-on: ubuntu-latest
timeout-minutes: 1
env:
base_ref: ${{ github.base_ref || github.event.repository.default_branch || 'master' }}
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
fetch-depth: 0
# The `-- .` is to avoid "ambiguous argument" errors from git
- name: Find fixup commits
run: |
echo Please rebase your fixup commits
git --version
git log --exit-code --extended-regexp \
--grep "^(fixup|squash|amend)! " \
--format="::error title=Must rebase before merge::%s" \
origin/${{ env.base_ref }}..${{ github.ref }} \
-- .
- name: Find "conventional commits" style messages
run: |
echo Conventional Commits breaks established commit message conventions.
echo Please follow these guidelines
echo
echo https://github.blog/2022-06-30-write-better-commits-build-better-projects/
echo https://www.tpope.net
git --version
git log --exit-code --extended-regexp --regexp-ignore-case \
--grep "^[a-z]+:" \
--format="::error title=Must follow commit guidelines, see step output::%s" \
origin/${{ env.base_ref }}..${{ github.ref }} \
-- .
- name: Find missing title cased messages
run: |
git --version
! git log \
--format="::error title=Must be properly capitalized::%s" \
origin/${{ env.base_ref }}..${{ github.ref }} \
-- . \
| grep '^::.*::[a-z]'
compile-deps:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
fetch-depth: 0
- uses: ./.github/actions/setup
id: setup
- name: Compile deps
if: steps.setup.outputs.cache-hit != 'true'
run: |
rebar3 compile --deps_only
rebar3 as test compile --deps_only
compile:
needs: [compile-deps]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
fetch-depth: 0
- uses: ./.github/actions/setup
- name: Compile
run: |
rebar3 compile
rebar3 as test compile
format:
name: Code formatting
needs: compile
runs-on: ubuntu-latest
timeout-minutes: 1
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
fetch-depth: 0
- uses: ./.github/actions/setup
- name: Run erlfmt
shell: bash
run: |
set -o pipefail
rebar3 fmt --check --verbose 2>&1 \
| sed -E 's/([^:]+):([0-9]+): (.+)/::error file=\1,line=\2::\3/g'
ct:
needs: [compile]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
fetch-depth: 0
- uses: ./.github/actions/setup
- name: Run CT tests
run: rebar3 ct
eunit:
needs: [compile]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
fetch-depth: 0
- uses: ./.github/actions/setup
- name: Run EUnit tests
run: rebar3 eunit
dialyzer:
needs: [compile]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
fetch-depth: 0
- uses: ./.github/actions/setup
- name: Run Dialyzer
run: rebar3 dialyzer
xref:
needs: [compile]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
fetch-depth: 0
- uses: ./.github/actions/setup
- name: Run xref
run: rebar3 xref