Skip to content

Commit

Permalink
Refactor CI workflow
Browse files Browse the repository at this point in the history
- use CargoSense/setup-elixir-project reusable workflow
- adds Ubuntu and macOS to the test matrix
- specifies oldest and newest Elixir and Erlang combo in the matrix
- use latest actions/checkout
- sets job name to use matrix values for clarity
  • Loading branch information
jgarber623-cargosense committed Aug 5, 2024
1 parent 928cbf8 commit eccb52e
Showing 1 changed file with 14 additions and 33 deletions.
47 changes: 14 additions & 33 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,48 +9,29 @@ on:

jobs:
test:
runs-on: ubuntu-20.04
name: Elixir ${{ matrix.pair.elixir }} OTP ${{ matrix.pair.otp }} (${{ matrix.os }})
runs-on: ${{ matrix.os }}
env:
MIX_ENV: test
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
include:
- pair:
elixir: "1.11"
otp: 22
elixir: "1.13"
otp: "24.3.4.10"
- pair:
elixir: "1.14"
otp: 25
lint: lint
elixir: "1.17"
otp: "27.0.1"
steps:
- uses: actions/checkout@v3

- uses: erlef/setup-beam@v1
with:
otp-version: ${{matrix.pair.otp}}
elixir-version: ${{matrix.pair.elixir}}

- uses: actions/cache@v3
- uses: actions/checkout@v4
- uses: CargoSense/setup-elixir-project@v1
with:
path: deps
key: ${{ runner.os }}-mix-${{matrix.pair.elixir}}-${{matrix.pair.otp}}-${{ hashFiles('**/mix.lock') }}-v1

- run: mix deps.get

otp-version: ${{ matrix.otp }}
elixir-version: ${{ matrix.elixir }}
build-flags: "--warnings-as-errors"
- run: mix format --check-formatted
if: ${{ matrix.lint }}

- run: mix deps.unlock --check-unused
if: ${{ matrix.lint }}

- run: mix deps.compile

- run: mix compile --warnings-as-errors
if: ${{ matrix.lint }}

- run: mix test
if: ${{ ! matrix.lint }}

- run: mix test --warnings-as-errors
if: ${{ matrix.lint }}

0 comments on commit eccb52e

Please sign in to comment.