-
Notifications
You must be signed in to change notification settings - Fork 178
75 lines (70 loc) · 2.35 KB
/
erlang.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
name: Erlang CI
on:
push:
branches: [develop]
pull_request:
branches: [develop]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
name: Test on ${{ matrix.os }} with OTP ${{ matrix.otp }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
otp: [22, 23, 24, 25]
os: [ubuntu-latest, macos-latest]
# OTP lower than 23 does not run on ubuntu-latest (22.04), see
# https://github.com/erlef/setup-beam#compatibility-between-operating-system-and-erlangotp
exclude:
- otp: 22
os: ubuntu-latest
- otp: 23
os: ubuntu-latest
include:
- otp: 22
os: ubuntu-20.04
- otp: 23
os: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Cache rebar3
uses: actions/cache@v3
with:
path: ~/.cache/rebar3
key: ${{runner.os}}-rebar3-cache-${{matrix.otp}}-v2-${{ hashFiles(format('rebar.lock')) }}
- name: Install dependencies (Linux)
if: ${{ startsWith(matrix.os, 'ubuntu') }}
run: |
sudo apt-get -qq update
sudo apt-get -qq install libsnappy-dev libc6-dev
- name: Configure Homebrew cache
if: ${{ startsWith(matrix.os, 'macos') }}
uses: actions/cache@v3
with:
path: |
~/Library/Caches/Homebrew/
~/Library/Caches/Homebrew/downloads/
key: brew-${{ runner.os }}-${{ matrix.otp }}
- name: Install Dependencies (OSX)
if: ${{ startsWith(matrix.os, 'macos') }}
run: |
export majorversion="$(cut -d '.' -f 1 <<< "${{ matrix.otp }}")"
brew install coreutils erlang@$majorversion snappy
echo "/usr/local/opt/erlang@$majorversion/bin" >> $GITHUB_PATH
- name: Install Erlang/OTP
# setup beam doesn't provide MacOS packages
# we use Homebrew to instal them
if: ${{ !startsWith(matrix.os , 'macos') }}
uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp }}
- name: Compile
run: ./rebar3 compile
- name: Run xref and dialyzer
run: ./rebar3 do xref, dialyzer
- name: Run tests
run: ./rebar3 as gha do eunit