Upgrade CI #108
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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-24.04'] | |
otp: ['27', '26', '25'] | |
rebar3: ['3.24.0'] | |
include: | |
- otp: '23' | |
rebar3: '3.20.0' | |
os: 'ubuntu-20.04' | |
- otp: '24' | |
rebar3: '3.22.1' | |
os: 'ubuntu-22.04' | |
- otp: '27' | |
rebar3: '3.24.0' | |
os: 'windows-2022' | |
- otp: '27' | |
rebar3: '3.24.0' | |
os: 'macos-latest' | |
runs-on: ${{matrix.os}} | |
steps: | |
- uses: actions/checkout@v4 | |
# OS setups | |
- name: Ubuntu/Windows – Prepare Erlang | |
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/[email protected] | |
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: MacOS – Prepare Brew | |
run: | | |
brew --version | |
brew cleanup --prune=all -s | |
brew autoremove | |
brew untap homebrew/cask homebrew/core | |
brew update | |
if: ${{ matrix.os == 'macos-latest' }} | |
- name: MacOS - Prepare Erlang | |
run: brew install erlang rebar3 | |
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 == '27' && matrix.os == 'ubuntu-24.04' }} | |
- name: Run coverage | |
if: ${{ matrix.otp == '27' && matrix.os == 'ubuntu-24.04' }} | |
run: | | |
rebar3 as test codecov analyze | |
gcov -o c_src fast_pbkdf2 | |
- name: Upload coverage reports to Codecov | |
if: ${{ matrix.otp == '27' && matrix.os == 'ubuntu-24.04' }} | |
uses: codecov/codecov-action@v3 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
test-on-s390x: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup emulator | |
run: | | |
sudo docker run --rm --privileged tonistiigi/binfmt:qemu-v6.2.0 | |
- name: Run build | |
uses: uraimo/[email protected] | |
with: | |
arch: s390x | |
distro: ubuntu22.04 | |
install: | | |
apt-get update -y | |
DEBIAN_FRONTEND=noninteractive apt-get install -y rebar3 gcc libssl-dev | |
run: | | |
echo "---rebar3 as test get-deps---" | |
rebar3 as test get-deps | |
echo "---rebar3 as test compile---" | |
rebar3 as test compile | |
echo "---rebar3 as test ct---" | |
rebar3 as test ct |