Skip to content

Commit

Permalink
Migrate circleci config to github workflow (#228)
Browse files Browse the repository at this point in the history
  • Loading branch information
aabmass authored Jan 20, 2023
1 parent d24a537 commit 86e06a3
Showing 1 changed file with 63 additions and 1 deletion.
64 changes: 63 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,71 @@ on:
branches: [main]
pull_request:
name: ci
env:
# Bump this to invalidate all caches
cache-version: 1

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
py:
- {version: "3.7", tox: "37"}
- {version: "3.8", tox: "38"}
- {version: "3.9", tox: "39"}
- {version: "3.10", tox: "310"}
env:
run-matrix-combo: ${{ matrix.py.version }}

name: Test ${{ matrix.py.version }}
steps:
- uses: actions/checkout@v3
- run: echo "hello world"
- name: Set up Python ${{ matrix.py.version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.py.version }}
- uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ env.cache-version }}-${{ env.run-matrix-combo }}-pip-${{ hashFiles('tox.ini', 'dev-constraints.txt') }}
restore-keys: |
${{ env.cache-version }}-${{ env.run-matrix-combo }}-pip
- name: Install tox
# Pin tox 3 because of https://github.com/rpkilby/tox-factor/issues/18
run: pip install -U tox==3.27.1 tox-factor
- name: Run tox test factors for python ${{ matrix.py.version }}
run: >
tox
--skip-missing-interpreters=true
-f py${{ matrix.py.tox }}-ci
lint:
runs-on: ubuntu-latest
strategy:
matrix:
target: [lint-ci, docs-ci, mypy-ci]
py:
- {version: "3.10"}

env:
run-matrix-combo: ${{ matrix.py.version }}-${{ matrix.target }}

name: ${{ matrix.target }}
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.py.version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.py.version }}
- uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ env.cache-version }}-${{ env.run-matrix-combo }}-pip-${{ hashFiles('tox.ini', 'dev-constraints.txt') }}
restore-keys: |
${{ env.cache-version }}-${{ env.run-matrix-combo }}-pip
- name: Install tox
# Pin tox 3 because of https://github.com/rpkilby/tox-factor/issues/18
run: pip install -U tox==3.27.1 tox-factor
- name: Run tox factors ${{ matrix.target }}
run: tox -f ${{ matrix.target }}

0 comments on commit 86e06a3

Please sign in to comment.