Fix CI: Build PLT explicitly and remove unnecessary docs job #3
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] | |
| env: | |
| MIX_ENV: test | |
| jobs: | |
| test: | |
| name: Test (Elixir ${{matrix.elixir}} OTP ${{matrix.otp}}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| elixir: ['1.15', '1.16', '1.17', '1.18', '1.19'] | |
| otp: ['25', '26', '27'] | |
| exclude: | |
| # Elixir 1.15 doesn't support OTP 27 | |
| - elixir: '1.15' | |
| otp: '27' | |
| # Elixir 1.16 doesn't support OTP 27 | |
| - elixir: '1.16' | |
| otp: '27' | |
| # Elixir 1.19 doesn't support OTP 25 | |
| - elixir: '1.19' | |
| otp: '25' | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Elixir | |
| uses: erlef/setup-beam@v1 | |
| with: | |
| elixir-version: ${{matrix.elixir}} | |
| otp-version: ${{matrix.otp}} | |
| - name: Restore dependencies cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| deps | |
| _build | |
| key: ${{ runner.os }}-mix-${{ matrix.elixir }}-${{ matrix.otp }}-${{ hashFiles('**/mix.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-mix-${{ matrix.elixir }}-${{ matrix.otp }}- | |
| - name: Install dependencies | |
| run: mix deps.get | |
| - name: Compile dependencies | |
| run: mix deps.compile | |
| - name: Compile project | |
| run: mix compile --warnings-as-errors | |
| - name: Run tests | |
| run: mix test | |
| quality: | |
| name: Code Quality | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| elixir: ['1.19'] | |
| otp: ['27'] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Elixir | |
| uses: erlef/setup-beam@v1 | |
| with: | |
| elixir-version: ${{matrix.elixir}} | |
| otp-version: ${{matrix.otp}} | |
| - name: Restore dependencies cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| deps | |
| _build | |
| key: ${{ runner.os }}-mix-${{ matrix.elixir }}-${{ matrix.otp }}-${{ hashFiles('**/mix.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-mix-${{ matrix.elixir }}-${{ matrix.otp }}- | |
| - name: Install dependencies | |
| run: mix deps.get | |
| - name: Check formatting | |
| run: mix format --check-formatted | |
| - name: Run Credo | |
| run: mix credo --strict | |
| - name: Restore PLT cache | |
| uses: actions/cache@v4 | |
| id: plt-cache | |
| with: | |
| path: priv/plts | |
| key: ${{ runner.os }}-plt-${{ matrix.elixir }}-${{ matrix.otp }}-${{ hashFiles('**/mix.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-plt-${{ matrix.elixir }}-${{ matrix.otp }}- | |
| - name: Create PLTs directory | |
| if: steps.plt-cache.outputs.cache-hit != 'true' | |
| run: mkdir -p priv/plts | |
| - name: Build PLT | |
| if: steps.plt-cache.outputs.cache-hit != 'true' | |
| run: mix dialyzer --plt | |
| - name: Run Dialyzer | |
| run: mix dialyzer --format github | |
| coverage: | |
| name: Test Coverage | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| elixir: ['1.19'] | |
| otp: ['27'] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Elixir | |
| uses: erlef/setup-beam@v1 | |
| with: | |
| elixir-version: ${{matrix.elixir}} | |
| otp-version: ${{matrix.otp}} | |
| - name: Restore dependencies cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| deps | |
| _build | |
| key: ${{ runner.os }}-mix-${{ matrix.elixir }}-${{ matrix.otp }}-${{ hashFiles('**/mix.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-mix-${{ matrix.elixir }}-${{ matrix.otp }}- | |
| - name: Install dependencies | |
| run: mix deps.get | |
| - name: Run tests with coverage | |
| run: mix coveralls.github | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |