Setup PR comment action for releases (#3521) #195
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: Electric Telemetry CI | |
| on: | |
| push: | |
| branches: ['main'] | |
| paths-ignore: | |
| - 'website/**' | |
| - '**/README.md' | |
| pull_request: | |
| paths-ignore: | |
| - 'website/**' | |
| - '**/README.md' | |
| permissions: | |
| contents: read | |
| jobs: | |
| build_and_test: | |
| name: Build and test electric-telemetry | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: packages/electric-telemetry | |
| env: | |
| MIX_ENV: test | |
| MIX_OS_DEPS_COMPILE_PARTITION_COUNT: 4 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: erlef/setup-beam@v1 | |
| with: | |
| version-type: strict | |
| version-file: '.tool-versions' | |
| - name: Cache electric-telemetry dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: packages/electric-telemetry/deps | |
| key: ${{ runner.os }}-electric-telemetry-deps-${{ hashFiles('packages/electric-telemetry/mix.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-electric-telemetry-deps-${{ hashFiles('packages/electric-telemetry/mix.lock') }} | |
| ${{ runner.os }}-electric-telemetry-deps- | |
| - name: Cache compiled code | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| packages/electric-telemetry/_build/*/lib | |
| !packages/electric-telemetry/_build/*/lib/electric_telemetry | |
| key: "${{ runner.os }}-electric-telemetry-build-${{ env.MIX_ENV }}-${{ hashFiles('packages/sync-service/mix.lock') }}" | |
| restore-keys: | | |
| ${{ runner.os }}-electric-telemetry-build-${{ env.MIX_ENV }}-${{ hashFiles('packages/sync-service/mix.lock') }} | |
| ${{ runner.os }}-electric-telemetry-build-${{ env.MIX_ENV }}- | |
| ${{ runner.os }}-electric-telemetry-build- | |
| - name: Install dependencies | |
| run: mix do deps.get + deps.compile | |
| - name: Compile | |
| # don't bail on compile warnings - let's get the results of the tests | |
| # and let the formatting task check for compilation warnings | |
| run: mix compile | |
| - name: Run tests | |
| run: mix coveralls.json | |
| - name: Upload coverage reports to CodeCov | |
| uses: codecov/codecov-action@ad3126e916f78f00edff4ed0317cf185271ccc2d | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| flags: elixir,unit-tests,electric-telemetry | |
| files: ./cover/excoveralls.json | |
| - name: Upload test results to CodeCov | |
| uses: codecov/test-results-action@f2dba722c67b86c6caa034178c6e4d35335f6706 | |
| if: ${{ !cancelled() }} | |
| env: | |
| DUMMY_COMMIT_SHA: ${{ github.event.pull_request.head.sha || github.sha }}-dummy | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| fail_ci_if_error: true | |
| flags: elixir,unit-tests,electric-telemetry | |
| files: ./junit/test-junit-report.xml | |
| # Upload all PR test results to single branch - requires overriding branch and commit | |
| override_branch: ${{ github.event_name == 'pull_request' && 'codecov/pr-test-aggregation' || '' }} | |
| override_commit: ${{ github.event_name == 'pull_request' && env.DUMMY_COMMIT_SHA || '' }} |