Skip to content

Commit

Permalink
convert CI compat jobs into single matrix job
Browse files Browse the repository at this point in the history
  • Loading branch information
mjheilmann committed Jan 18, 2025
1 parent 3dd31d7 commit a775ac7
Showing 1 changed file with 17 additions and 42 deletions.
59 changes: 17 additions & 42 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,16 @@ on:

env:
MIX_ENV: test
LATEST_ELIXIR: 1.18.x
LATEST_OTP: 27.2.x

jobs:
validate_1_13:
name: Validate PR against 1.13
elixir_compatibility:
name: "Check library against a compatability matrix"
strategy:
matrix:
elixir_version: [1.13.x, 1.14.x, 1.15.x, 1.16.x, 1.17.x, 1.18.x]
otp_version: [25.1.x, 25.3.x, 26.2.x, 27.2.x]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -22,8 +28,8 @@ jobs:
id: beam
uses: erlef/setup-beam@v1
with:
otp-version: 25.1.x
elixir-version: 1.13.x
otp-version: ${{ matrix.otp_version }}
elixir-version: ${{ matrix.elixir_version }}

- name: Restore dependencies cache
id: mix_cache
Expand All @@ -43,8 +49,9 @@ jobs:
- name: Run test
run: mix test

validate_1_14:
name: Validate PR against 1.14
# run extra steps on latest supported
extra_checks:
name: Lint and check on latest runtime
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -53,40 +60,8 @@ jobs:
id: beam
uses: erlef/setup-beam@v1
with:
otp-version: 25.1.x
elixir-version: 1.14.x

- name: Restore dependencies cache
id: mix_cache
uses: actions/cache@v4
with:
path: |
deps
_build
key: mix-${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-${{ hashFiles('**/mix.lock') }}
restore-keys: mix-${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-

- name: Install Dependencies
run: |
mix deps.get
mix deps.compile
- name: Run test
run: mix test

# run all steps on latest supported
validate_1_15:
name: Validate PR against 1.15
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Elixir
id: beam
uses: erlef/setup-beam@v1
with:
otp-version: 25.1.x
elixir-version: 1.15.x
otp-version: $LATEST_OTP
elixir-version: $LATEST_ELIXIR

- name: Restore dependencies cache
id: mix_cache
Expand Down Expand Up @@ -150,8 +125,8 @@ jobs:
id: beam
uses: erlef/setup-beam@v1
with:
otp-version: 25.1.x
elixir-version: 1.15.x
otp-version: $LATEST_OTP
elixir-version: $LATEST_ELIXIR

- name: Restore dependencies cache
id: mix_cache
Expand Down

0 comments on commit a775ac7

Please sign in to comment.