-
Notifications
You must be signed in to change notification settings - Fork 7
85 lines (80 loc) · 2.61 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
name: ci
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
test:
name: OTP ${{matrix.otp}} / rebar3 ${{matrix.rebar3}} / OS ${{matrix.os}}
strategy:
matrix:
os: ['ubuntu-22.04']
otp: ['26.1', '25.3', '24.3']
rebar3: ['3.22.1']
include:
- otp: '26.1'
rebar3: '3.22.1'
os: 'windows-2022'
- otp: '26.1'
rebar3: '3.22.1'
os: 'macos-latest'
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v3
# OS setups
- uses: erlef/setup-beam@v1
with:
otp-version: ${{matrix.otp}}
rebar3-version: ${{matrix.rebar3}}
if: ${{ matrix.os != 'macos-latest' }}
- name: Windows - Enable Developer Command Prompt
uses: ilammy/msvc-dev-cmd@v1.12.1
if: ${{ matrix.os == 'windows-2022' }}
- name: Windows - Install openssl
shell: pwsh
run: |
choco install openssl
echo "OPENSSL_INSTALL_DIR=""C:\Program Files\OpenSSL""" >> $env:GITHUB_ENV
if: ${{ matrix.os == 'windows-2022' }}
- name: Brew Version Check
run: |
brew --version
brew cleanup --prune=all -s
brew autoremove
brew untap homebrew/cask homebrew/core
# brew update
# brew upgrade
# brew doctor
if: ${{ matrix.os == 'macos-latest' }}
- name: Install Erlang
run: brew install erlang@26.1
if: ${{ matrix.os == 'macos-latest' }}
# caches
- name: Restore _build
uses: actions/cache@v3
with:
path: _build
key: _build-cache-for-os-${{matrix.os}}-otp-${{matrix.otp}}-rebar3-${{matrix.rebar3}}-hash-${{hashFiles('rebar.lock')}}
- name: Restore rebar3's cache
uses: actions/cache@v3
with:
path: ~/.cache/rebar3
key: rebar3-cache-for-os-${{matrix.os}}-otp-${{matrix.otp}}-rebar3-${{matrix.rebar3}}-hash-${{hashFiles('rebar.lock')}}
# tests
- run: rebar3 as test get-deps
- run: rebar3 as test compile
- run: rebar3 as test ct
- run: rebar3 dialyzer
if: ${{ matrix.otp == '26.1' && matrix.os == 'ubuntu-22.04' }}
- name: Run coverage
if: ${{ matrix.otp == '26.1' && matrix.os == 'ubuntu-22.04' }}
run: |
rebar3 as test codecov analyze
gcov -o c_src fast_pbkdf2
- name: Upload coverage
if: ${{ matrix.otp == '26.1' && matrix.os == 'ubuntu-22.04' }}
run: |
pip install --user codecov
/home/runner/.local/bin/codecov