feat: added mix format
action
#12
Workflow file for this run
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
name: "Run `mix format`" | |
on: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
tests: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
working-directory: ./tololo | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: nixbuild/nix-quick-install-action@v29 | |
# - uses: DeterminateSystems/magic-nix-cache-action@v2 | |
- name: Install devenv.sh | |
run: nix profile install nixpkgs#devenv | |
- name: Cache deps | |
id: cache-deps | |
uses: actions/cache@v4 | |
env: | |
cache-name: cache-elixir-deps | |
with: | |
path: tololo/deps | |
key: ${{ runner.os }}-mix-${{ env.cache-name }}-${{ hashFiles('**/mix.lock') }} | |
restore-keys: | | |
${{ runner.os }}-mix-${{ env.cache-name }}- | |
# Step: Define how to cache the `_build` directory. After the first run, | |
# this speeds up tests runs a lot. This includes not re-compiling our | |
# project's downloaded deps every run. | |
- name: Cache compiled build | |
id: cache-build | |
uses: actions/cache@v4 | |
env: | |
cache-name: cache-compiled-build | |
with: | |
path: tololo/_build | |
key: ${{ runner.os }}-mix-${{ env.cache-name }}-${{ hashFiles('**/mix.lock') }} | |
restore-keys: | | |
${{ runner.os }}-mix-${{ env.cache-name }}- | |
${{ runner.os }}-mix- | |
- name: Run `mix format` | |
# run: devenv shell | |
run: devenv --impure tasks run mix:format | |
env: | |
MIX_ENV: ci | |