ci: upload coverage via excoveralls cobertura #11
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: | |
| permissions: | |
| contents: read | |
| jobs: | |
| ci: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - elixir: "1.19" | |
| otp: "26" | |
| - elixir: "1.20" | |
| otp: "27" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: erlef/setup-beam@v1 | |
| with: | |
| elixir-version: ${{ matrix.elixir }} | |
| otp-version: ${{ matrix.otp }} | |
| - 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 }}- | |
| - uses: actions/cache@v4 | |
| with: | |
| path: ~/.mix/plts | |
| key: ${{ runner.os }}-plts-${{ matrix.elixir }}-${{ matrix.otp }}-${{ hashFiles('mix.exs') }} | |
| - name: Fetch dependencies | |
| run: mix deps.get | |
| - name: Quality gates | |
| run: mix ci | |
| coverage: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: erlef/setup-beam@v1 | |
| with: | |
| elixir-version: "1.20" | |
| otp-version: "29" | |
| - uses: actions/cache@v4 | |
| with: | |
| path: | | |
| deps | |
| _build | |
| key: ${{ runner.os }}-mix-1.20-29-${{ hashFiles('**/mix.lock') }} | |
| restore-keys: ${{ runner.os }}-mix-1.20-29- | |
| - name: Fetch dependencies | |
| run: mix deps.get | |
| - name: Generate coverage report | |
| env: | |
| MIX_ENV: test | |
| run: mix coveralls.cobertura | |
| - name: Upload coverage artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: cobertura.xml | |
| path: cover/cobertura.xml | |
| - name: Comment coverage summary on pull request | |
| if: github.event_name == 'pull_request' | |
| uses: irongut/CodeCoverageSummary@v1.3.0 | |
| with: | |
| filename: cover/cobertura.xml | |
| badge: true | |
| format: markdown | |
| output: both |