Skip to content

[pre-commit.ci] pre-commit suggestions #1125

[pre-commit.ci] pre-commit suggestions

[pre-commit.ci] pre-commit suggestions #1125

Workflow file for this run

name: CI internal
# see: https://help.github.com/en/actions/reference/events-that-trigger-workflows
on: # Trigger the workflow on push or pull request, but only for the main branch
push: {}
pull_request:
branches: [main]
defaults:
run:
shell: bash
jobs:
pytest-internal:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04 , macOS-10.15, windows-2019]
python: ["3.9"]
# Timeout: https://stackoverflow.com/a/59076067/4521646
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Get pip cache dir
id: pip-cache
run: echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-py${{ matrix.python }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: ${{ runner.os }}-py${{ matrix.python }}-pip-
- name: Install requirements
run: |
pip install -q -r requirements.txt
- name: Testing
run: |
coverage run -m pytest _actions -v --junitxml="junit/test-results-${{ runner.os }}-${{ matrix.python }}.xml"
- name: Upload pytest test results
uses: actions/upload-artifact@v3
with:
name: pytest-results-${{ runner.os }}-${{ matrix.python }}
path: junit/test-results-${{ runner.os }}-${{ matrix.python }}.xml
if: failure()
- name: Statistics
if: success()
run: |
coverage report
coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
if: always()
# see: https://github.com/actions/toolkit/issues/399
continue-on-error: true
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage.xml
flags: cpu,pytest,${{ runner.os }}
name: CLI-coverage
fail_ci_if_error: false