-
-
Notifications
You must be signed in to change notification settings - Fork 14
71 lines (63 loc) · 1.7 KB
/
ci.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
name: CI
on: [pull_request]
jobs:
test:
name: "Test"
runs-on: ubuntu-20.04
# See https://hexdocs.pm/elixir/compatibility-and-deprecations.html#compatibility-between-elixir-and-erlang-otp
strategy:
matrix:
include:
- pair:
otp: "23.3.4.20"
elixir: "1.14.5"
- pair:
otp: "27.0"
elixir: "1.17.1"
lint: lint
env:
MIX_ENV: test
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup BEAM
uses: erlef/setup-beam@v1
with:
otp-version: ${{matrix.pair.otp}}
elixir-version: ${{matrix.pair.elixir}}
- 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: Check Code Format
run: mix format --check-formatted
if: ${{matrix.lint}}
- name: Run Tests
run: |
mix deps.get
mix test
- name: Publish Results
uses: dorny/test-reporter@v1
if: ${{ failure() }}
with:
fail-on-error: "false"
list-suites: failed
list-tests: failed
name: Results
path: _build/test/lib/oapi_generator/*.xml
reporter: java-junit
diff:
name: "Generate Diff"
runs-on: ubuntu-latest
steps:
- name: Dispatch Workflow
env:
GH_TOKEN: ${{ secrets.DIFF_TOKEN }}
run: |
gh workflow run generate.yml --repo aj-foster/open-api-diffs --field ref=$GITHUB_HEAD_REF