-
Notifications
You must be signed in to change notification settings - Fork 331
104 lines (90 loc) · 2.63 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
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
name: CI
on:
pull_request:
push:
env:
node-version: 18.x
jobs:
mix_test:
runs-on: ubuntu-20.04
env:
MIX_ENV: test
strategy:
fail-fast: false
matrix:
include:
- pair: # Test very old elixir and Erlang
elixir: "1.13"
otp: "22"
- pair: # Test Erlang without -doc attribute support
elixir: "1.16"
otp: "26"
- pair: # Test Erlang with -doc attribute support
elixir: "1.17"
otp: "27"
lint: lint
steps:
- uses: actions/checkout@v3
- uses: erlef/setup-beam@v1
with:
otp-version: ${{matrix.pair.otp}}
elixir-version: ${{matrix.pair.elixir}}
- name: Install Dependencies
run: mix deps.get
- run: mix format --check-formatted
if: ${{ matrix.lint }}
- run: mix deps.unlock --check-unused
if: ${{ matrix.lint }}
- run: mix deps.compile
- run: mix compile --warnings-as-errors
if: ${{ matrix.lint }}
- run: mix test
- name: Prerelease
run: test/prerelease.sh
- name: Generate docs
run: |
mix docs
test -f doc/index.html && echo "doc/index.html exists."
test -f doc/ExDoc.epub && echo "doc/ExDoc.epub exists."
check_js:
name: Check JS
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ env.node-version }}
- name: Cache npm dependencies
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('asssets/package-lock.json') }}
- run: npm install --prefix assets
- run: npm run lint --prefix assets
- run: sudo apt-get install xvfb
- run: |
xvfb-run --auto-servernum npm run test --prefix assets
env:
CI: true
assets:
needs: [check_js]
runs-on: ubuntu-20.04
if: github.ref_name == 'main'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ env.node-version }}
- name: Cache npm dependencies
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('asssets/package-lock.json') }}
- run: mkdir -p tmp/handlebars
- run: npm ci --prefix assets
- run: npm run build --prefix assets
- name: Push updated assets
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Update assets
file_pattern: formatters