feat(build): decouple host extraction from files and supervision #13
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: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| test: | |
| name: Test (Elixir ${{ matrix.elixir }} / OTP ${{ matrix.otp }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - elixir: "1.17" | |
| otp: "27" | |
| - elixir: "1.18" | |
| otp: "27" | |
| - elixir: "1.19" | |
| otp: "28" | |
| - elixir: "1.20" | |
| otp: "28" | |
| env: | |
| MIX_ENV: test | |
| steps: | |
| - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6 | |
| - name: Set up Elixir | |
| uses: erlef/setup-beam@54075bcc5e249e4758d363f27d099f55d843f124 # v1 | |
| with: | |
| elixir-version: ${{ matrix.elixir }} | |
| otp-version: ${{ matrix.otp }} | |
| - name: Restore deps and build cache | |
| uses: actions/cache@caa296126883cff596d87d8935842f9db880ef25 # v5 | |
| with: | |
| path: | | |
| deps | |
| _build | |
| key: ${{ runner.os }}-mix-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-mix-${{ matrix.otp }}-${{ matrix.elixir }}- | |
| - name: Install dependencies | |
| run: mix deps.get | |
| - name: Compile (warnings as errors) | |
| run: mix compile --warnings-as-errors | |
| - name: Tests with coverage | |
| if: ${{ matrix.elixir != '1.20' || matrix.otp != '28' }} | |
| run: mix coveralls | |
| - name: Tests with coverage report | |
| if: ${{ matrix.elixir == '1.20' && matrix.otp == '28' }} | |
| run: mix coveralls.json | |
| - name: Upload coverage to Codecov | |
| if: ${{ matrix.elixir == '1.20' && matrix.otp == '28' }} | |
| uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v6.0.2 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: cover/excoveralls.json | |
| fail_ci_if_error: false | |
| quality: | |
| name: Quality | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6 | |
| - name: Set up Elixir | |
| uses: erlef/setup-beam@54075bcc5e249e4758d363f27d099f55d843f124 # v1 | |
| with: | |
| elixir-version: "1.18" | |
| otp-version: "27" | |
| - name: Restore deps and build cache | |
| uses: actions/cache@caa296126883cff596d87d8935842f9db880ef25 # v5 | |
| with: | |
| path: | | |
| deps | |
| _build | |
| key: ${{ runner.os }}-quality-${{ hashFiles('**/mix.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-quality- | |
| - name: Install dependencies | |
| run: mix deps.get | |
| - name: Check dependency lock | |
| run: mix deps.unlock --check-unused | |
| - name: Audit retired packages | |
| run: mix hex.audit | |
| - name: Audit advisories | |
| run: mix deps.audit | |
| - name: Check formatting | |
| run: mix format --check-formatted | |
| - name: Credo | |
| run: mix credo --strict | |
| - name: Doctor | |
| run: mix doctor | |
| - name: Compile without optional dependencies | |
| run: mix compile --no-optional-deps --warnings-as-errors | |
| env: | |
| MIX_ENV: no_optional | |
| # Runs before the benchmarks so the Performance pages come from the | |
| # committed measurements rather than a smoke run | |
| - name: Build documentation | |
| run: mix docs --warnings-as-errors | |
| - name: Build Hex package | |
| run: mix hex.build | |
| # CI=true shortens every suite; this only proves they still execute | |
| - name: Smoke-run benchmarks | |
| run: mix bench | |
| dialyzer: | |
| name: Dialyzer | |
| runs-on: ubuntu-latest | |
| env: | |
| MIX_ENV: dev | |
| steps: | |
| - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6 | |
| - name: Set up Elixir | |
| uses: erlef/setup-beam@54075bcc5e249e4758d363f27d099f55d843f124 # v1 | |
| with: | |
| elixir-version: "1.18" | |
| otp-version: "27" | |
| - name: Restore deps and build cache | |
| uses: actions/cache@caa296126883cff596d87d8935842f9db880ef25 # v5 | |
| with: | |
| path: | | |
| deps | |
| _build | |
| key: ${{ runner.os }}-dialyzer-${{ hashFiles('**/mix.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-dialyzer- | |
| - name: Restore PLT cache | |
| uses: actions/cache@caa296126883cff596d87d8935842f9db880ef25 # v5 | |
| with: | |
| path: priv/plts | |
| key: ${{ runner.os }}-plt-${{ hashFiles('**/mix.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-plt- | |
| - name: Install dependencies | |
| run: mix deps.get | |
| - name: Build PLT | |
| run: mix dialyzer --plt | |
| - name: Run Dialyzer | |
| run: mix dialyzer --format github |