forked from elixir-lang/ex_doc
-
Notifications
You must be signed in to change notification settings - Fork 0
102 lines (89 loc) · 2.46 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
name: CI
on:
pull_request:
push:
branches:
- main
env:
node-version: 18.x
jobs:
mix_test:
runs-on: ubuntu-20.04
env:
MIX_ENV: test
strategy:
fail-fast: false
matrix:
include:
- pair:
elixir: "1.11"
otp: "21"
- pair:
elixir: "1.14"
otp: "26"
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