Update pip-dependencies #695
Workflow file for this run
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: tests | |
on: | |
push: | |
branches: main | |
paths-ignore: | |
- "examples/**" | |
- "scripts/**" | |
- "stats_website/**" | |
- "**.md" | |
- "**.json" | |
- "**.csv" | |
- "**.html" | |
pull_request: | |
paths-ignore: | |
- "examples/**" | |
- "scripts/**" | |
- "stats_website/**" | |
- "**.md" | |
- "**.json" | |
- "**.csv" | |
- "**.html" | |
workflow_dispatch: | |
schedule: | |
- cron: "0 0 * * *" | |
permissions: | |
contents: read | |
env: | |
FORCE_COLOR: 1 # Request colored output from CLI tools supporting it | |
PIP_DISABLE_PIP_VERSION_CHECK: 1 | |
PY_COLORS: 1 # Recognized by the `py` package, dependency of `pytest` | |
# TERM is needed for FORCE_COLOR to work on mypy on Ubuntu, | |
# see https://github.com/python/mypy/issues/13817 | |
TERM: xterm-256color | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
COVERALLS_PARALLEL: true | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
pytest-tests: | |
name: Run tests with pytest | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: ["ubuntu-latest", "windows-latest", "macos-latest"] | |
python-version: ["3.10", "3.11"] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }} | |
uses: actions/setup-python@v4 | |
with: | |
cache: "pip" | |
cache-dependency-path: "pyproject.toml" | |
python-version: ${{ matrix.python-version }} | |
- run: pip install "wheel<1" | |
- run: pip install "coveralls>=3.3" -e .[pytest] | |
- run: pip freeze --all | |
- name: Run tests under coverage | |
run: | | |
coverage run -m pytest --doctest-modules | |
coverage report --no-skip-covered | |
- name: Upload coverage to coveralls | |
if: github.repository == 'AlexWaygood/typeshed-stats' | |
env: | |
COVERALLS_FLAG_NAME: ${{ matrix.os }}-${{ matrix.python-version }} | |
run: coveralls --service=github | |
coveralls-finish: | |
name: Indicate completion to coveralls.io | |
needs: pytest-tests | |
if: github.repository == 'AlexWaygood/typeshed-stats' | |
runs-on: ubuntu-latest | |
container: python:3-slim | |
steps: | |
- run: | | |
pip install "coveralls>=3.3" | |
coveralls --service=github --finish | |
create-issue-on-failure: | |
name: Create an issue if daily test failed | |
runs-on: ubuntu-latest | |
needs: pytest-tests | |
if: >- | |
${{ | |
github.repository == 'AlexWaygood/typeshed-stats' | |
&& always() | |
&& github.event_name == 'schedule' | |
&& needs.pytest-tests.result == 'failure' | |
}} | |
permissions: | |
issues: write | |
steps: | |
- uses: actions/github-script@v6 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
script: | | |
await github.rest.issues.create({ | |
owner: "AlexWaygood", | |
repo: "typeshed-stats", | |
title: `Daily test failed on ${new Date().toDateString()}`, | |
body: "Runs are listed here: https://github.com/AlexWaygood/typeshed-stats/actions/workflows/test.yml", | |
}) |