54 lines (44 loc) · 1.53 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
name: CI
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
env:
PARSER: ${{ matrix.parser }}
container:
image: hexpm/elixir:${{ matrix.elixir }}-erlang-${{ matrix.erlang }}-ubuntu-${{ matrix.ubuntu }}
name: Elixir ${{ matrix.elixir }} / Erlang ${{ matrix.erlang }} with ${{ matrix.parser }} and Ubuntu ${{matrix.ubuntu}}
strategy:
fail-fast: false
matrix:
elixir: ["1.9.4", "1.8.2", "1.7.4", "1.6.6"]
erlang: ["21.3.8"]
ubuntu: ["bionic-20200219"]
parser: [fast_html, html5ever, mochiweb]
steps:
- uses: actions/checkout@v1.0.0
- name: Install dependencies
run: |-
apt-get update
if [ "$PARSER" = "fast_html" ]; then apt-get -y install build-essential cmake; fi
if [ "$PARSER" = "html5ever" ]; then apt-get -y install build-essential git curl; fi
mix local.rebar --force
mix local.hex --force
mix deps.get
- name: Install minimal stable Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
if: matrix.parser == 'html5ever'
- name: Check format
if: (!startsWith(matrix.elixir, '1.6') && !startsWith(matrix.elixir, '1.7'))
run: mix format --check-formatted
- name: Run tests
run: |-
mix test.$PARSER
- name: Run inch.report
if: matrix.elixir >= 1.7
run: |-
mix deps.get --only docs
MIX_ENV=docs mix inch.report