-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add receptorctl coverage reporting (#1025)
- Loading branch information
1 parent
772774f
commit 1a17043
Showing
5 changed files
with
94 additions
and
34 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
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 |
---|---|---|
|
@@ -4,6 +4,11 @@ name: CI | |
on: # yamllint disable-line rule:truthy | ||
pull_request: # yamllint disable-line rule:empty-values | ||
|
||
env: | ||
DESIRED_GO_VERSION: '1.20' | ||
DESIRED_GOLANGCI_LINT_VERSION: 'v1.56' | ||
DESIRED_PYTHON_VERSION: '3.11' | ||
|
||
jobs: | ||
lint-receptor: | ||
name: lint-receptor | ||
|
@@ -16,11 +21,12 @@ jobs: | |
- uses: actions/setup-go@v5 | ||
with: | ||
cache: false | ||
go-version: '1.20' | ||
go-version: ${{ env.DESIRED_GO_VERSION }} | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v6 | ||
with: | ||
version: v1.56 | ||
version: ${{ env.DESIRED_GOLANGCI_LINT_VERSION }} | ||
|
||
receptor: | ||
name: receptor (Go ${{ matrix.go-version }}) | ||
runs-on: ubuntu-latest | ||
|
@@ -85,39 +91,41 @@ jobs: | |
with: | ||
name: receptor | ||
path: /usr/local/bin/receptor | ||
|
||
receptorctl: | ||
name: Run receptorctl tests${{ '' }} # Nest jobs under the same sidebar category | ||
name: Run receptorctl tests${{ '' }} # Nest jobs under the same sidebar category | ||
needs: receptor | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: | ||
# NOTE: The highest and the lowest versions come | ||
# NOTE: first as their statuses are most likely to | ||
# NOTE: signal problems early: | ||
- 3.11 | ||
- 3.8 | ||
- >- | ||
3.10 | ||
- 3.9 | ||
# NOTE: The highest and the lowest versions come | ||
# NOTE: first as their statuses are most likely to | ||
# NOTE: signal problems early: | ||
- 3.11 | ||
- 3.8 | ||
- >- | ||
3.10 | ||
- 3.9 | ||
uses: ./.github/workflows/reusable-nox.yml | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
session: tests-${{ matrix.python-version }} | ||
download-receptor: true | ||
|
||
lint-receptorctl: | ||
name: Lint receptorctl${{ '' }} # Nest jobs under the same sidebar category | ||
name: Lint receptorctl${{ '' }} # Nest jobs under the same sidebar category | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
session: | ||
- check_style | ||
- check_format | ||
- check_style | ||
- check_format | ||
uses: ./.github/workflows/reusable-nox.yml | ||
with: | ||
python-version: 3.11 | ||
python-version: '3.11' | ||
session: ${{ matrix.session }} | ||
|
||
container: | ||
name: container | ||
runs-on: ubuntu-latest | ||
|
@@ -130,7 +138,7 @@ jobs: | |
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.11' | ||
python-version: ${{ env.DESIRED_PYTHON_VERSION }} | ||
|
||
- name: Install python dependencies | ||
run: pip install build | ||
|
@@ -167,3 +175,50 @@ jobs: | |
echo "Output did not contain expected value" | ||
exit 1 | ||
fi | ||
receptorctl-test-coverage: | ||
name: Receptorctl test coverage | ||
needs: receptor | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
session: | ||
- coverage | ||
steps: | ||
- name: Download the `receptor` binary | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: receptor | ||
path: /usr/local/bin/ | ||
|
||
- name: Set executable bit on the `receptor` binary | ||
run: sudo chmod a+x /usr/local/bin/receptor | ||
|
||
- name: Set up nox | ||
uses: wntrblm/[email protected] | ||
with: | ||
python-versions: ${{ env.DESIRED_PYTHON_VERSION }} | ||
|
||
- name: Check out the source code from Git | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # Needed for the automation in Nox to find the last tag | ||
|
||
- name: Provision nox environment for ${{ matrix.session }} | ||
run: nox --install-only --session ${{ matrix.session }} | ||
working-directory: ./receptorctl | ||
|
||
- name: Run `receptorctl` nox ${{ matrix.session }} session | ||
run: nox --no-install --session ${{ matrix.session }} | ||
working-directory: ./receptorctl | ||
|
||
- name: Upload coverage reports to Codecov | ||
uses: codecov/codecov-action@v4 | ||
with: | ||
directory: receptorctl | ||
files: receptorctl_coverage.xml | ||
fail_ci_if_error: true | ||
flags: receptorctl | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
verbose: true |
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,2 +1,2 @@ | ||
[run] | ||
omit = "tests/" | ||
omit = tests/* |
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
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,3 +1,5 @@ | ||
# This requirements file is used for receptorctl tests | ||
|
||
pytest==8.2.0 # <-- used to run receptorctl tests | ||
pytest-cov | ||
coverage |