Skip to content

[pre-commit.ci] pre-commit autoupdate #65

[pre-commit.ci] pre-commit autoupdate

[pre-commit.ci] pre-commit autoupdate #65

# This file is managed by 'repo_helper'. Don't edit it directly.
---
name: Linux
on:
push:
branches-ignore:
- 'repo-helper-update'
- 'pre-commit-ci-update-config'
- 'imgbot'
tags:
- '*'
pull_request:
permissions:
actions: write
issues: write
contents: read
jobs:
tests:
name: "ubuntu-20.04 / Python ${{ matrix.config.python-version }}"
runs-on: "ubuntu-20.04"
continue-on-error: ${{ matrix.config.experimental }}
env:
USING_COVERAGE: '3.7,3.8,3.9,3.10'
strategy:
fail-fast: False
matrix:
config:
- {python-version: "3.7", testenvs: "py37,build", experimental: False}
- {python-version: "3.8", testenvs: "py38,build", experimental: False}
- {python-version: "3.9", testenvs: "py39,build", experimental: False}
- {python-version: "3.10", testenvs: "py310,build", experimental: False}
steps:
- name: Checkout πŸ›ŽοΈ
uses: "actions/checkout@v2"
- name: Check for changed files
if: startsWith(github.ref, 'refs/tags/') != true
uses: dorny/paths-filter@v2
id: changes
with:
list-files: "json"
filters: |
code:
- '!(doc-source/**|CONTRIBUTING.rst|.imgbotconfig|.pre-commit-config.yaml|.pylintrc|.readthedocs.yml)'
- name: Setup Python 🐍
id: setup-python
if: ${{ steps.changes.outputs.code == 'true' || steps.changes.outcome == 'skipped' }}
uses: "actions/setup-python@v2"
with:
python-version: "${{ matrix.config.python-version }}"
- name: Install dependencies πŸ”§
if: steps.setup-python.outcome == 'success'
run: |
python -VV
python -m site
python -m pip install --upgrade pip setuptools wheel
python -m pip install --upgrade tox virtualenv!=20.16.0
python -m pip install --upgrade coverage_pyver_pragma
- name: "Run Tests for Python ${{ matrix.config.python-version }}"
if: steps.setup-python.outcome == 'success'
run: python -m tox -e "${{ matrix.config.testenvs }}" -s false
- name: "Upload Coverage πŸš€"
uses: actions/upload-artifact@v2
if: ${{ always() && steps.setup-python.outcome == 'success' }}
with:
name: "coverage-${{ matrix.config.python-version }}"
path: .coverage
Coverage:
needs: tests
runs-on: "ubuntu-20.04"
steps:
- name: Checkout πŸ›ŽοΈ
uses: "actions/checkout@v2"
- name: Setup Python 🐍
uses: "actions/setup-python@v2"
with:
python-version: 3.8
- name: Install dependencies πŸ”§
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install --upgrade "coveralls>=3.0.0" coverage_pyver_pragma
- name: "Download Coverage πŸͺ‚"
uses: actions/download-artifact@v2
with:
path: coverage
- name: Display structure of downloaded files
id: show
run: ls -R
working-directory: coverage
continue-on-error: true
- name: Combine Coverage πŸ‘·
if: ${{ steps.show.outcome != 'failure' }}
run: |
shopt -s globstar
python -m coverage combine coverage/**/.coverage
- name: "Upload Combined Coverage Artefact πŸš€"
if: ${{ steps.show.outcome != 'failure' }}
uses: actions/upload-artifact@v2
with:
name: "combined-coverage"
path: .coverage
- name: "Upload Combined Coverage to Coveralls"
if: ${{ steps.show.outcome != 'failure' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
coveralls --service=github