Skip to content

Actually map over new statistics and explain why we do the mapping #689

Actually map over new statistics and explain why we do the mapping

Actually map over new statistics and explain why we do the mapping #689

Workflow file for this run

name: CI
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
on: [pull_request, push]
jobs:
linux:
name: Test on Ubuntu (Elixir ${{ matrix.elixir_version }}, OTP ${{ matrix.otp_version }})
runs-on: ubuntu-24.04
strategy:
matrix:
# Run tests at least once for every supported elixir or erlang version
#
# Since all the code is running at least once with each version, that should cover enough.
# Like, what are the chances a bug would happen on 1.18@26 but not on 1.17@26 or 1.18@27?
# And if it does, it's more likely an elixir bug than a benchee bug. We'll see.
# We've been using enough of githubs CI resources and our own wait time :)
#
# https://hexdocs.pm/elixir/compatibility-and-deprecations.html#between-elixir-and-erlang-otp
#
# We're also further limited by the support the setup-beam action offers:
# https://github.com/erlef/setup-beam?tab=readme-ov-file#compatibility-between-operating-system-and-erlangotp
include:
- elixir_version: '1.11'
otp_version: '24.3'
- elixir_version: '1.12'
otp_version: '24.3'
- elixir_version: '1.13'
otp_version: '25.3'
- elixir_version: '1.14'
otp_version: '25.3'
- elixir_version: '1.15'
otp_version: '26.2'
- elixir_version: '1.16'
otp_version: '26.2'
- elixir_version: '1.17'
otp_version: '27.3'
- elixir_version: '1.18'
otp_version: '27.3'
type_check: true
lint: true
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Elixir
uses: erlef/setup-beam@v1
with:
elixir-version: ${{ matrix.elixir_version }}
otp-version: ${{ matrix.otp_version }}
- name: Restore deps and _build
uses: actions/cache@v3
with:
path: |
deps
_build
key: erlef-${{ runner.os }}-mix-${{ matrix.elixir_version }}-${{ matrix.otp_version }}-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- name: Restore plts
uses: actions/cache@v3
with:
path: tools/plts
key: erlef-${{ runner.os }}-dialyzer-${{ matrix.elixir_version }}-${{ matrix.otp_version }}-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
if: ${{ matrix.type_check }}
- run: mix deps.get
- run: MIX_ENV=test mix compile --warnings-as-errors
- run: mix credo
if: ${{ matrix.lint }}
- name: Check if formatted
if: ${{ matrix.lint }}
run: mix format --check-formatted
- name: Actual Tests
# this will let warnings slip through but I don't wanna replicate all that magic
# right now
run: MIX_ENV=test mix coveralls.github || mix test --failed
# Apparently the one with `!` can't go without the fancy expression syntax
if: ${{ !matrix.lint }}
# warnings as errors is a form of linting!
- name: Actual Tests WITH warnings as errors
run: MIX_ENV=test mix coveralls.github --warnings-as-errors || mix test --failed
if: ${{ matrix.lint }}
- name: Dialyzer
run: mix dialyzer --halt-exit-status
if: ${{ matrix.type_check }}
macos:
name: Test on MacOS
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v3
# no versioning on brew but getting asdf or something was a bigger headache
- name: Install Elixir
run: brew install elixir
- name: Restore deps and _build
uses: actions/cache@v3
with:
path: |
deps
_build
key: ${{ runner.os }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- run: mix local.hex --force
- run: mix deps.get
- run: mix local.rebar --force
- run: MIX_ENV=test mix compile --warnings-as-errors
- run: mix test || mix test --failed
windows:
name: Test on Windows
runs-on: windows-2022
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Elixir
uses: erlef/setup-beam@v1
with:
elixir-version: '1.18'
otp-version: '27.3'
- name: Get deps
run: mix deps.get
- name: Test
run: mix test || mix test --failed