[pre-commit.ci] pre-commit suggestions #1316
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
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: | |
branches: [main] | |
pull_request: {} | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
pytest-internal: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-20.04, macOS-11, windows-2022] | |
python: ["3.10"] | |
# Timeout: https://stackoverflow.com/a/59076067/4521646 | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python }} | |
uses: actions/setup-python@v5 | |
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@v4 | |
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 | |
- name: Statistics | |
run: | | |
coverage report | |
coverage xml | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v4 | |
# 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 | |
testing-guardian: | |
runs-on: ubuntu-latest | |
needs: pytest-internal | |
if: always() | |
steps: | |
- run: echo "${{ needs.pytester.result }}" | |
- name: failing... | |
if: needs.pytester.result == 'failure' | |
run: exit 1 | |
- name: cancelled or skipped... | |
if: contains(fromJSON('["cancelled", "skipped"]'), needs.pytester.result) | |
timeout-minutes: 1 | |
run: sleep 90 |