Skip to content

Commit

Permalink
Update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
hissssst committed Mar 30, 2024
1 parent c9bb84b commit 8c15ed9
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 19 deletions.
73 changes: 54 additions & 19 deletions .github/workflows/ci.yml
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ pathex-*.tar
# Nix auto shell
.direnv
.envrc
.nix-mix
.nix-hex

0 comments on commit 8c15ed9

Please sign in to comment.