[pre-commit.ci] pre-commit autoupdate (#832) #1404
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: build | |
on: | |
push: | |
pull_request: | |
# build weekly at 4:00 AM UTC | |
schedule: | |
- cron: '0 4 * * 1' | |
jobs: | |
lint: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
name: "lint on ${{ matrix.os }} " | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Identify week number | |
shell: bash | |
run: | | |
date +'%V' > week-number.txt | |
date +'week-number=%V' >> $GITHUB_ENV | |
- uses: actions/setup-python@v4 | |
id: setup-python | |
with: | |
python-version: "3.10" | |
cache: "pip" | |
cache-dependency-path: | | |
.github/workflows/build.yaml | |
setup.cfg | |
setup.py | |
tox.ini | |
week-number.txt | |
- name: Restore cache | |
id: restore-cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
.tox/ | |
.venv/ | |
key: > | |
lint | |
week=${{ env.week-number }} | |
os=${{ matrix.os }} | |
python=${{ steps.setup-python.outputs.python-version }} | |
hash=${{ hashFiles('.github/workflows/build.yaml', 'tox.ini', 'setup.cfg', 'setup.py') }} | |
- name: Identify venv path | |
shell: bash | |
run: echo 'venv-path=${{ runner.os == 'Windows' && '.venv/Scripts' || '.venv/bin' }}' >> $GITHUB_ENV | |
- name: install tox | |
if: steps.restore-cache.outputs.cache-hit == false | |
run: | | |
python -m venv .venv | |
${{ env.venv-path }}/pip install --upgrade pip setuptools wheel | |
${{ env.venv-path }}/pip install tox | |
- name: run mypy | |
run: ${{ env.venv-path }}/tox -e mypy | |
test: | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] | |
# we do not want a large number of windows and macos builds, so | |
# enumerate them explicitly | |
include: | |
- os: windows-latest | |
python-version: "3.10" | |
- os: macos-latest | |
python-version: "3.10" | |
name: "test py${{ matrix.python-version }} on ${{ matrix.os }}" | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Identify week number | |
shell: bash | |
run: | | |
date +'%V' > week-number.txt | |
date +'week-number=%V' >> $GITHUB_ENV | |
- uses: actions/setup-python@v4 | |
id: setup-python | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: "pip" | |
cache-dependency-path: | | |
.github/workflows/build.yaml | |
setup.cfg | |
setup.py | |
tox.ini | |
week-number.txt | |
- name: Restore cache | |
id: restore-cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
.tox | |
.venv | |
key: > | |
test | |
week=${{ env.week-number }} | |
os=${{ matrix.os }} | |
python=${{ steps.setup-python.outputs.python-version }} | |
hash=${{ hashFiles('.github/workflows/build.yaml', 'setup.cfg', 'setup.py', 'tox.ini') }} | |
- name: Identify venv path | |
shell: bash | |
run: echo 'venv-path=${{ runner.os == 'Windows' && '.venv/Scripts' || '.venv/bin' }}' >> $GITHUB_ENV | |
- name: install tox | |
if: steps.restore-cache.outputs.cache-hit == false | |
run: | | |
python -m venv .venv | |
${{ env.venv-path }}/pip install --upgrade pip setuptools wheel | |
${{ env.venv-path }}/pip install tox | |
- name: run tests | |
run: ${{ env.venv-path }}/tox -e py | |
docs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Identify week number | |
shell: bash | |
run: | | |
date +'%V' > week-number.txt | |
date +'week-number=%V' >> $GITHUB_ENV | |
- uses: actions/setup-python@v4 | |
id: setup-python | |
with: | |
python-version: "3.10" | |
cache: "pip" | |
cache-dependency-path: | | |
.github/workflows/build.yaml | |
setup.cfg | |
setup.py | |
tox.ini | |
week-number.txt | |
- name: Restore cache | |
id: restore-cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
.tox | |
.venv | |
key: > | |
docs | |
week=${{ env.week-number }} | |
python=${{ steps.setup-python.outputs.python-version }} | |
hash=${{ hashFiles('.github/workflows/build.yaml', 'setup.cfg', 'setup.py', 'tox.ini') }} | |
- name: install tox | |
if: steps.restore-cache.outputs.cache-hit == false | |
run: | | |
python -m venv .venv | |
.venv/bin/pip install --upgrade pip setuptools wheel | |
.venv/bin/pip install tox | |
- name: test reference docs generation | |
run: .venv/bin/tox -e reference | |
test-package-metadata: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Identify week number | |
shell: bash | |
run: | | |
date +'%V' > week-number.txt | |
date +'week-number=%V' >> $GITHUB_ENV | |
- uses: actions/setup-python@v4 | |
id: setup-python | |
with: | |
python-version: "3.10" | |
cache: "pip" | |
cache-dependency-path: | | |
.github/workflows/build.yaml | |
setup.cfg | |
setup.py | |
tox.ini | |
week-number.txt | |
- name: Restore cache | |
id: restore-cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
.tox | |
.venv | |
key: > | |
test-package-metadata | |
week=${{ env.week-number }} | |
python=${{ steps.setup-python.outputs.python-version }} | |
hash=${{ hashFiles('.github/workflows/build.yaml', 'setup.cfg', 'setup.py', 'tox.ini') }} | |
- name: install tox | |
if: steps.restore-cache.outputs.cache-hit == false | |
run: | | |
python -m venv .venv | |
.venv/bin/pip install --upgrade pip setuptools wheel | |
.venv/bin/pip install tox | |
- name: check package metadata | |
run: .venv/bin/tox -e twine-check | |
test-mindeps: | |
runs-on: ubuntu-latest | |
name: "mindeps" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Identify week number | |
shell: bash | |
run: | | |
date +'%V' > week-number.txt | |
date +'week-number=%V' >> $GITHUB_ENV | |
- uses: actions/setup-python@v4 | |
id: setup-python | |
with: | |
python-version: "3.7" | |
cache: "pip" | |
cache-dependency-path: | | |
.github/workflows/build.yaml | |
setup.cfg | |
setup.py | |
tox.ini | |
week-number.txt | |
- name: Restore cache | |
id: restore-cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
.tox | |
.venv | |
key: > | |
test-mindeps | |
week=${{ env.week-number }} | |
python=${{ steps.setup-python.outputs.python-version }} | |
hash=${{ hashFiles('.github/workflows/build.yaml', 'setup.cfg', 'setup.py', 'tox.ini') }} | |
- name: install tox | |
if: steps.restore-cache.outputs.cache-hit == false | |
run: | | |
python -m venv .venv | |
.venv/bin/pip install --upgrade pip setuptools wheel | |
.venv/bin/pip install tox | |
- name: test | |
run: .venv/bin/tox -e py-mindeps | |
test-sdk-main: | |
strategy: | |
matrix: | |
python-version: ["3.7", "3.11"] | |
runs-on: ubuntu-latest | |
name: "sdk-main" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Identify week number | |
shell: bash | |
run: | | |
date +'%V' > week-number.txt | |
date +'week-number=%V' >> $GITHUB_ENV | |
- uses: actions/setup-python@v4 | |
id: setup-python | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: "pip" | |
cache-dependency-path: | | |
.github/workflows/build.yaml | |
setup.cfg | |
setup.py | |
tox.ini | |
week-number.txt | |
- name: Restore cache | |
id: restore-cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
.tox | |
.venv | |
key: > | |
test-sdk-main | |
week=${{ env.week-number }} | |
python=${{ steps.setup-python.outputs.python-version }} | |
hash=${{ hashFiles('.github/workflows/build.yaml', 'setup.cfg', 'setup.py', 'tox.ini') }} | |
- name: install tox | |
if: steps.restore-cache.outputs.cache-hit == false | |
run: | | |
python -m venv .venv | |
.venv/bin/pip install --upgrade pip setuptools wheel | |
.venv/bin/pip install tox | |
- run: .venv/bin/tox -e py-sdkmain | |
# use the oldest python version we support for this build | |
test-ancient-virtualenv: | |
name: "test on py3.7, using old virtualenv" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Identify week number | |
run: date +'%V' > week-number.txt | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.7" | |
cache: "pip" | |
cache-dependency-path: | | |
.github/workflows/build.yaml | |
setup.cfg | |
setup.py | |
tox.ini | |
week-number.txt | |
- run: python -m pip install -U pip setuptools | |
- name: Downgrade Virtualenv | |
run: python -m pip install 'virtualenv==16.7.12' | |
- name: Create virtualenv | |
run: virtualenv venv | |
- name: Install Into Virtualenv | |
run: venv/bin/python -m pip install '.[test]' | |
- name: Run tests | |
run: venv/bin/pytest |