-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
20 additions
and
32 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 |
---|---|---|
@@ -1,46 +1,20 @@ | ||
name: Code Coverage | ||
|
||
# Run it when you push to all branches | ||
on: | ||
push: | ||
name: coverage | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Build binary files | ||
run: | | ||
make build | ||
coverage: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install gcov | ||
run: | | ||
if ! command -v gcov &>/dev/null; then | ||
echo "gcov is not installed. Installing..." | ||
sudo apt-get update | ||
sudo apt-get install -y gcov | ||
fi | ||
echo "gcov is installed." | ||
- name: Generate Coverage | ||
- name: Evaluate coverage | ||
run: | | ||
make build | ||
COVERAGE=$(make coverage | grep 'TOTAL COVERAGE' | grep -Eo '[0-9]+') | ||
if [ "$COVERAGE" -gt 89 ]; then | ||
echo "success" | ||
else | ||
echo "failure" | ||
fi | ||
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,14 @@ | ||
name: test | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
coverage: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Run tests | ||
run: | | ||
make test |
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