gh workflow update #56
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
# This workflow uses actions that are not certified by GitHub. | |
# They are provided by a third-party and are governed by | |
# separate terms of service, privacy policy, and support | |
# documentation. | |
name: Elixir CI | |
env: | |
MIX_ENV: test | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
permissions: | |
contents: read | |
jobs: | |
build: | |
name: Build and test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: DeterminateSystems/nix-installer-action@main | |
- uses: DeterminateSystems/magic-nix-cache-action@main | |
- uses: DeterminateSystems/flake-checker-action@main | |
- name: Restore dependencies cache | |
uses: actions/cache@v3 | |
with: | |
path: deps | |
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }} | |
restore-keys: ${{ runner.os }}-mix- | |
- name: install mix | |
run: nix develop -c mix local.hex | |
- name: Run flakes check | |
run: | | |
nix flake check | |
nix develop -c echo OK | |
- name: Install dependencies | |
run: nix develop -c mix deps.get | |
# - name: Run Credo | |
# run: mix credo --strict | |
# - name: Retrieve PLT Cache | |
# uses: actions/cache@v1 | |
# id: plt-cache | |
# with: | |
# path: priv/plts | |
# key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-plts-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }} | |
# - name: Create PLTs | |
# if: steps.plt-cache.outputs.cache-hit != 'true' | |
# run: | | |
# mkdir -p priv/plts | |
# mix dialyzer --plt | |
# - name: Run dialyzer | |
# run: mix dialyzer --no-check --halt-exit-status | |
- name: Check Formatting | |
run: nix develop -c mix format --check-formatted | |
- name: Run tests | |
run: nix develop -c mix test | |
# - name: Build docs | |
# run: mix docs |