-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
24 additions
and
44 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,34 @@ | ||
name: Test | ||
on: [push, pull_request] | ||
|
||
permissions: | ||
contents: read | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
tests: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [3.7, 3.8, 3.9, 3.10-dev] | ||
max-parallel: 1 | ||
python: | ||
- "3.8" | ||
- "3.9" | ||
- "3.10" | ||
- "3.11" | ||
- "3.12-dev" | ||
fail-fast: false | ||
|
||
steps: | ||
- name: Print github context | ||
env: | ||
GITHUB_CONTEXT: ${{ toJson(github) }} | ||
run: echo $GITHUB_CONTEXT | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 1 | ||
|
||
- name: pycache | ||
uses: actions/cache@v2 | ||
id: pycache | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
- name: Setup python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
if: "!endsWith(matrix.python-version, '-dev')" | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Setup python ${{ matrix.python-version }} (via deadsnakes) | ||
uses: deadsnakes/[email protected] | ||
if: "endsWith(matrix.python-version, '-dev')" | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install tox and test related | ||
- uses: actions/checkout@v3 | ||
- name: Setup Python ${{ matrix.python }} | ||
uses: actions/setup-python@v4 | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install tox tox-gh-actions | ||
python -m pip install --upgrade tox | ||
- name: Run tox | ||
run: | | ||
|
@@ -58,20 +42,16 @@ jobs: | |
env: [flake8, mypy] | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 1 | ||
|
||
- uses: actions/checkout@v3 | ||
- name: Setup python | ||
uses: actions/setup-python@v2 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.8 | ||
python-version: "3" | ||
|
||
- name: Install tox and any other dependencies for test | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install tox tox-gh-actions | ||
python -m pip install --upgrade tox | ||
- name: Run tox | ||
run: tox -e ${{ matrix.env }} |