Skip to content

Commit

Permalink
GitHub Actions workflow improvements (#6)
Browse files Browse the repository at this point in the history
This PR refactors the existing CI workflow. Notable changes include:

- renaming the file to `ci.yml` to better reflect its function,
- replaces much of the setup-related job steps with
[CargoSense/setup-elixir-project](https://github.com/CargoSense/setup-elixir-project)
reusable Action,
- adds `workflow_dispatch` as an event trigger so that we may manually
invoke the Action (should that prove useful)

~~I've retained the use of a matrix even though there's only one
configured OTP and Elixir version. @billylanchantin and I have been
chatting about what an improved test matrix might look like, but haven't
yet come to a conclusion. One we do, I'm happy to update the matrix with
additional versions.~~

Updated in c9e6068. Pulling out my commit message since it includes some
relevant notes:

> This required using an older version of Ubuntu to support older
Erlang/OTP versions. Pulled that bit of knowledge from the README here:
>
> https://github.com/erlef/setup-beam
> 
> Additionally, Erlang/OTP compatibility charts are maintained here:
> 
>
https://hexdocs.pm/elixir/compatibility-and-deprecations.html#between-elixir-and-erlang-otp
> 
> …and lastly, the matrix expansion via `include` is documented here:
> 
>
https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs#expanding-or-adding-matrix-configurations
> 
> I'm _mostly_ confident this will work as desired.
  • Loading branch information
jgarber623-cargosense authored Jun 7, 2024
2 parents 4bc64df + c9e6068 commit 382572a
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 85 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: CI

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
workflow_dipatch:

jobs:
test:
name: OTP ${{ matrix.otp }} / Elixir ${{ matrix.elixir }}
runs-on: ubuntu-20.04
env:
MIX_ENV: test
strategy:
fail-fast: false
matrix:
elixir: ["1.16", "1.15", "1.14", "1.13"]
include:
- otp: [26, 25, 24]
- elixir: "1.14"
otp: [25, 24, 23]
- elixir: "1.13"
otp: [24, 23, 22]
steps:
- uses: actions/checkout@v4
- uses: CargoSense/setup-elixir-project@v1
with:
otp-version: ${{ matrix.otp }}
elixir-version: ${{ matrix.elixir }}
build-flags: "--warnings-as-errors"
- run: mix format --check-formatted
- run: mix test
85 changes: 0 additions & 85 deletions .github/workflows/elixir.yaml

This file was deleted.

0 comments on commit 382572a

Please sign in to comment.