-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ci): split off coverage workflow (#1944)
In #1936 we observed that because we are using `pull_request_target` without a specific reference, we are not in fact checking out the PR branch. This PR splits the workflow into two, one only to run badger CI tests, and the other to run tests & report coverage results (using pr_target with the appropriate commit). This has the benefit that any issues with coverage are isolated to one workflow, which we could disable later if problems arise. This does create duplication of compute (all tests run x2) but we are using github hosted runners so we do not pay for this cost. This also aligns with our dgraph repo workflow setup.
- Loading branch information
1 parent
9afd0a0
commit 2c431a9
Showing
2 changed files
with
33 additions
and
7 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: ci-badger-tests-coverage | ||
on: | ||
pull_request_target: | ||
branches: | ||
- main | ||
- 'release/v*' | ||
jobs: | ||
badger-tests-coverage: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v3 # checkout merge commit | ||
with: | ||
ref: "refs/pull/${{ github.event.number }}/merge" | ||
- name: Get Go Version | ||
run: | | ||
#!/bin/bash | ||
GOVERSION=$({ [ -f .go-version ] && cat .go-version; }) | ||
echo "GOVERSION=$GOVERSION" >> $GITHUB_ENV | ||
- name: Setup Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: ${{ env.GOVERSION }} | ||
- name: Install Dependencies | ||
run: make dependency | ||
- name: Run Badger Tests | ||
run: make test | ||
- name: Install Goveralls | ||
run: go install github.com/mattn/goveralls@latest | ||
- name: Send Coverage Results | ||
env: | ||
COVERALLS_TOKEN: ${{ secrets.COVERALLSIO_TOKEN }} | ||
run: goveralls -coverprofile=cover.out |
This file contains 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