WIP #125
Workflow file for this run
This file contains hidden or 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: FeebDB | |
| on: [push] | |
| env: | |
| MIX_ENV: test | |
| FEEBDB_TEST_DATA_DIR: /tmp/feebdb/test_dbs | |
| jobs: | |
| tests: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Check out repository code | |
| uses: actions/checkout@v4 | |
| - name: Setup backend environment | |
| uses: erlef/setup-beam@v1 | |
| with: | |
| version-file: .tool-versions | |
| version-type: strict | |
| - name: Setup database directories | |
| run: mkdir -p ${{ env.FEEBDB_TEST_DATA_DIR }} | |
| - name: Restore build cache | |
| uses: actions/cache@v4 | |
| id: mix_cache | |
| with: | |
| path: | | |
| deps | |
| _build | |
| key: test-${{ runner.os }}-mix-${{ hashFiles('mix.lock') }} | |
| - name: Install Elixir Dependencies | |
| if: steps.mix_cache.outputs.cache-hit != 'true' | |
| run: | | |
| mix local.rebar --force | |
| mix local.hex --force | |
| mix deps.get | |
| mix deps.compile | |
| - name: Compile app | |
| run: mix compile --warnings-as-errors | |
| - name: Check formatting | |
| run: mix format --check-formatted | |
| - name: Quick tests | |
| run: mix test | |
| # It's important that the coverage comes from the full test suite (i.e. with `slow` tests) | |
| # because these tests cover lines that were not covered by the quick tests. | |
| - name: Full test suite + coverage | |
| run: mix coveralls.github --include slow | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| linters: | |
| runs-on: ubuntu-24.04 | |
| env: | |
| MIX_ENV: dev | |
| steps: | |
| - name: Check out repository code | |
| uses: actions/checkout@v4 | |
| - name: Setup backend environment | |
| uses: erlef/setup-beam@v1 | |
| with: | |
| version-file: .tool-versions | |
| version-type: strict | |
| - name: Restore build cache | |
| uses: actions/cache@v4 | |
| id: mix_cache | |
| with: | |
| path: | | |
| deps | |
| _build | |
| key: dev-${{ runner.os }}-mix-${{ hashFiles('mix.lock') }} | |
| - name: Install Elixir Dependencies | |
| if: steps.mix_cache.outputs.cache-hit != 'true' | |
| run: | | |
| mix local.rebar --force | |
| mix local.hex --force | |
| mix deps.get | |
| mix deps.compile | |
| # Restore PLT cache (if any). Note this is a cache/restore action | |
| - name: Restore PLT cache | |
| id: plt_cache | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: _build/dev/*.plt* | |
| # NOTE: The "official" Dialyxir example includes the mix.lock file but I'm explicitly | |
| # removing it for incremental updates | |
| key: | | |
| plt-${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-plt | |
| - name: Create PLTs | |
| if: steps.plt_cache.outputs.cache-hit != 'true' | |
| run: mix dialyzer --plt | |
| # Save the PLT cache. Note this is a cache/save action | |
| - name: Save PLT cache | |
| id: plt_cache_save | |
| uses: actions/cache/save@v4 | |
| if: steps.plt_cache.outputs.cache-hit != 'true' | |
| with: | |
| path: _build/dev/*.plt* | |
| key: | | |
| plt-${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-plt | |
| - name: Run dialyzer | |
| run: mix dialyzer --format github |