github-actions(deps): bump actions/checkout from 3 to 4 #368
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 Core | |
on: | |
push: | |
branches-ignore: | |
- 'dependabot/**' | |
paths-ignore: | |
- 'docs/**' | |
- 'docs_requirements.txt' | |
tags-ignore: | |
- 'v**' | |
pull_request: | |
paths-ignore: | |
- 'docs/**' | |
- 'docs_requirements.txt' | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: [3.7, 3.8, 3.9, '3.10', 3.11] | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
with: | |
# need history and tags for versioneer | |
fetch-depth: 0 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5.0.0 | |
with: | |
python-version: ${{ matrix.python-version }} | |
architecture: ${{ matrix.python-architecture }} | |
- name: Get pip cache location | |
shell: bash | |
id: pip_cache | |
run: | | |
python -m pip install -U pip | |
python -m pip --version | |
echo ::set-output name=pip_cache_dir::$(python -m pip cache dir) | |
- name: Wheels cache | |
uses: actions/cache@v3.3.1 | |
with: | |
path: ${{ steps.pip_cache.outputs.pip_cache_dir }}/wheels | |
key: ${{ runner.os }}-python-${{ matrix.python-version }}-${{ matrix.python-architecture }}-pip-wheels-v2-${{ github.sha }} | |
restore-keys: ${{ runner.os }}-python-${{ matrix.python-version }}-${{ matrix.python-architecture }}-pip-wheels-v2 | |
- name: Install package | |
run: python -m pip install -r dev_requirements.txt && python -m pip install -e . | |
- name: Install coverage helper | |
if: ${{ matrix.python-version == 3.9 }} | |
run: python -m pip install coveragepy-lcov "coverage<7.0.0" | |
- name: Install Graphviz | |
uses: tlylt/install-graphviz@v1 | |
- name: Lint with flake8 | |
shell: bash | |
run: | | |
pip install flake8 | |
# stop the build if there are Python syntax errors or undefined names | |
flake8 . --count --exit-zero --select=E9,F63,F7,F82 --show-source --statistics | |
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | |
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | |
- name: Test with pytest | |
timeout-minutes: 80 | |
run: pytest --junit-xml=tests_out.xml --verbosity=0 -n auto --ignore tests/integration/ | |
- name: Upload test results | |
uses: actions/upload-artifact@v3 | |
with: | |
name: test-results-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.python-architecture }} | |
path: tests_out.xml | |
retention-days: 5 | |
if: success() || failure() | |
- name: Convert coverage file | |
if: ${{ matrix.python-version == 3.9 && matrix.os == 'ubuntu-latest' }} | |
run: | | |
coveragepy-lcov --data_file_path .coverage --output_file_path lcov.info | |
- name: Upload to Coveralls | |
if: ${{ matrix.python-version == 3.9 && matrix.os == 'ubuntu-latest' }} | |
uses: coverallsapp/github-action@master | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
path-to-lcov: lcov.info | |
- name: Build dist | |
run: | | |
pip install setuptools wheel | |
python setup.py sdist bdist_wheel | |
- name: Upload dist packages | |
uses: actions/upload-artifact@v3 | |
with: | |
name: dist-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.python-architecture }} | |
path: dist/ | |
retention-days: 2 |