-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
56 additions
and
19 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,60 @@ | ||
name: ci | ||
name: CI Workflow | ||
|
||
on: [push, pull_request] | ||
on: | ||
pull_request: | ||
branches: [ main ] | ||
push: | ||
branches: [ main ] | ||
|
||
jobs: | ||
build: | ||
name: Elixir ${{matrix.elixir}} (Erlang/OTP ${{matrix.otp}}) | ||
runs-on: ubuntu-latest | ||
test: | ||
strategy: | ||
matrix: | ||
otp: ['26'] | ||
elixir: ['1.14', '1.15', '1.16'] | ||
otp-version = ['26'] | ||
elixir-version: ['1.14', '1.15', '1.16'] | ||
name: CI | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: erlef/setup-beam@v1 | ||
with: | ||
otp-version: ${{ matrix.otp }} | ||
elixir-version: ${{ matrix.elixir }} | ||
- run: mix deps.get | ||
- run: mix compile --warnings-as-errors | ||
# - run: mix credo --strict | ||
- name: "Check formatted?" | ||
run: mix format mix.exs "{lib,test}/**/*.{ex,exs}" --check-formatted | ||
if: ${{ startsWith(matrix.elixir, '1.11XX') }} | ||
- run: mix test | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Erlang and Elixir | ||
uses: erlef/setup-beam@v1 | ||
id: setup-beam | ||
with: | ||
otp-version: ${{ matrix.otp-version }} | ||
elixir-version: ${{ matrix.elixir-version }} | ||
|
||
- name: Restore dependencies and _build | ||
uses: actions/cache/restore@v3 | ||
with: | ||
key: mix-${{ steps.setup-beam.outputs.otp-version }}-${{ steps.setup-beam.outputs.elixir-version }}-${{ hashFiles('mix.lock') }} | ||
path: | | ||
_build | ||
deps | ||
restore-keys: | | ||
mix-${{ steps.setup-beam.outputs.otp-version }}-${{ steps.setup-beam.outputs.elixir-version }}- | ||
mix-${{ steps.setup-beam.outputs.otp-version }}- | ||
mix- | ||
- name: Download and compile dependencies | ||
run: | | ||
mix deps.get | ||
mix deps.compile | ||
- name: Check formatting and compile | ||
run: | | ||
mix compile --warnings-as-errors | ||
- name: Cache dependencies and _build | ||
uses: actions/cache/save@v3 | ||
with: | ||
key: mix-${{ steps.setup-beam.outputs.otp-version }}-${{ steps.setup-beam.outputs.elixir-version }}-${{ hashFiles('mix.lock') }} | ||
path: | | ||
_build | ||
deps | ||
- name: Run tests | ||
run: | | ||
mix test --warnings-as-errors |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,3 +27,5 @@ pathex-*.tar | |
# Nix auto shell | ||
.direnv | ||
.envrc | ||
.nix-mix | ||
.nix-hex |