Skip to content

Merge pull request #2345 from VWS-Python/rm-type #1434

Merge pull request #2345 from VWS-Python/rm-type

Merge pull request #2345 from VWS-Python/rm-type #1434

Workflow file for this run

---
# 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: "Set up Python"
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
# We do not use the cache action as uv is faster than the cache action.
- name: "Install dependencies"
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
uv pip install --system --upgrade --editable .[dev]
- name: "Set secrets file"
run: |
cp ./vuforia_secrets.env.example ./vuforia_secrets.env
- name: "Run tests"
run: |
pytest \
--skip-docker_build_tests \
--skip-docker_in_memory \
--skip-mock \
--skip-real \
--capture=no \
-vvv \
--exitfirst \
--cov=src/ \
--cov=tests/ \
--cov-report=xml \
.
- 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' }}