ci: release already publishes docs #35
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: | |
| pull_request: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| test: | |
| permissions: | |
| checks: write | |
| name: OTP ${{ matrix.otp }} / rebar3 ${{ matrix.rebar3 }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| # Latest - run all checks | |
| - otp: '28.1' | |
| rebar3: '3.25.0' | |
| lint: true | |
| dialyzer: true | |
| coverage: true | |
| # Stable | |
| - otp: '27.2' | |
| rebar3: '3.25.0' | |
| # Minimum supported | |
| - otp: '25.3' | |
| rebar3: '3.24.0' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Erlang/OTP | |
| uses: erlef/setup-beam@v1 | |
| with: | |
| otp-version: ${{ matrix.otp }} | |
| rebar3-version: ${{ matrix.rebar3 }} | |
| - name: Cache dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: _build/default/lib | |
| key: deps-${{ runner.os }}-otp-${{ matrix.otp }}-${{ hashFiles('rebar.lock') }} | |
| restore-keys: | | |
| deps-${{ runner.os }}-otp-${{ matrix.otp }}- | |
| - name: Cache PLTs | |
| uses: actions/cache@v4 | |
| if: ${{ matrix.dialyzer }} | |
| with: | |
| path: _build/*/rebar3_*_plt | |
| key: plt-${{ runner.os }}-otp-${{ matrix.otp }}-${{ hashFiles('rebar.lock') }} | |
| restore-keys: | | |
| plt-${{ runner.os }}-otp-${{ matrix.otp }}- | |
| - name: Compile | |
| run: rebar3 compile | |
| - name: Check formatting | |
| if: ${{ matrix.lint }} | |
| run: rebar3 fmt --check | |
| - name: Run xref | |
| if: ${{ matrix.lint }} | |
| run: rebar3 xref | |
| - name: Run dialyzer | |
| if: ${{ matrix.dialyzer }} | |
| run: rebar3 dialyzer | |
| - name: Install nghttpx | |
| run: sudo apt-get update && sudo apt-get install -y nghttp2 | |
| - name: Run tests | |
| id: test | |
| run: rebar3 test | |
| - name: Upload CT logs on failure | |
| if: ${{ failure() && steps.test.outcome == 'failure' }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ct-logs-otp-${{ matrix.otp }} | |
| path: _build/test/logs | |
| - name: Generate coverage report | |
| if: ${{ matrix.coverage }} | |
| run: rebar3 covertool generate | |
| - name: Upload coverage to Codecov | |
| if: ${{ matrix.coverage }} | |
| uses: codecov/codecov-action@v5.5.2 | |
| with: | |
| files: _build/test/covertool/gen_http.covertool.xml | |
| fail_ci_if_error: true | |
| flags: erlang-${{ matrix.otp }} | |
| name: Erlang/OTP ${{ matrix.otp }} | |
| verbose: true | |
| token: ${{ secrets.CODECOV_TOKEN }} |