Merge pull request #2424 from VWS-Python/bump-pytest-settings #1674
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
--- | |
# We check that using all --skip options does not error. | |
name: Skip tests | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
schedule: | |
# * is a special character in YAML so you have to quote this string | |
# Run at 1:00 every day | |
- cron: 0 1 * * * | |
workflow_dispatch: {} | |
jobs: | |
build: | |
strategy: | |
matrix: | |
python-version: ['3.12'] | |
platform: [ubuntu-latest] | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
# See https://github.com/codecov/codecov-action/issues/190. | |
fetch-depth: 2 | |
- name: Install uv | |
uses: astral-sh/setup-uv@v3 | |
- name: Set secrets file | |
run: | | |
cp ./vuforia_secrets.env.example ./vuforia_secrets.env | |
- name: Run tests | |
run: | | |
uv run --extra=dev pytest \ | |
--skip-docker_build_tests \ | |
--skip-docker_in_memory \ | |
--skip-mock \ | |
--skip-real \ | |
--capture=no \ | |
-vvv \ | |
--exitfirst \ | |
--cov=src/ \ | |
--cov=tests/ \ | |
--cov-report=xml \ | |
. | |
env: | |
UV_PYTHON: ${{ matrix.python-version }} | |
- name: Show coverage file | |
run: | | |
# Sometimes we have been sure that we have 100% coverage, but codecov | |
# says otherwise. | |
# | |
# We show the coverage file here to help with debugging. | |
# https://github.com/VWS-Python/vws-python-mock/issues/708 | |
cat ./coverage.xml | |
# We run this job on every PR, on every merge to main, and nightly. | |
# This causes us to hit an issue with Codecov. | |
# | |
# We see "Too many uploads to this commit.". | |
# See https://community.codecov.io/t/too-many-uploads-to-this-commit/2574. | |
# | |
# To work around this, we do not upload coverage data on scheduled runs. | |
# We print the event name here to help with debugging. | |
- name: Show event name | |
run: | | |
echo ${{ github.event_name }} | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
fail_ci_if_error: true | |
# See https://community.codecov.com/t/upload-issues-unable-to-locate-build-via-github-actions-api/3954 | |
# which tells us to use the token to avoid errors. | |
token: ${{ secrets.CODECOV_TOKEN }} | |
if: ${{ github.event_name == 'pull_request' || github.event_name == 'push' }} |