Skip to content

Commit 86e06a3

Browse files
authored
Migrate circleci config to github workflow (#228)
1 parent d24a537 commit 86e06a3

File tree

1 file changed

+63
-1
lines changed

1 file changed

+63
-1
lines changed

.github/workflows/ci.yaml

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,71 @@ on:
33
branches: [main]
44
pull_request:
55
name: ci
6+
env:
7+
# Bump this to invalidate all caches
8+
cache-version: 1
9+
610
jobs:
711
test:
812
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
py:
16+
- {version: "3.7", tox: "37"}
17+
- {version: "3.8", tox: "38"}
18+
- {version: "3.9", tox: "39"}
19+
- {version: "3.10", tox: "310"}
20+
env:
21+
run-matrix-combo: ${{ matrix.py.version }}
22+
23+
name: Test ${{ matrix.py.version }}
924
steps:
1025
- uses: actions/checkout@v3
11-
- run: echo "hello world"
26+
- name: Set up Python ${{ matrix.py.version }}
27+
uses: actions/setup-python@v4
28+
with:
29+
python-version: ${{ matrix.py.version }}
30+
- uses: actions/cache@v3
31+
with:
32+
path: ~/.cache/pip
33+
key: ${{ env.cache-version }}-${{ env.run-matrix-combo }}-pip-${{ hashFiles('tox.ini', 'dev-constraints.txt') }}
34+
restore-keys: |
35+
${{ env.cache-version }}-${{ env.run-matrix-combo }}-pip
36+
- name: Install tox
37+
# Pin tox 3 because of https://github.com/rpkilby/tox-factor/issues/18
38+
run: pip install -U tox==3.27.1 tox-factor
39+
- name: Run tox test factors for python ${{ matrix.py.version }}
40+
run: >
41+
tox
42+
--skip-missing-interpreters=true
43+
-f py${{ matrix.py.tox }}-ci
44+
45+
lint:
46+
runs-on: ubuntu-latest
47+
strategy:
48+
matrix:
49+
target: [lint-ci, docs-ci, mypy-ci]
50+
py:
51+
- {version: "3.10"}
52+
53+
env:
54+
run-matrix-combo: ${{ matrix.py.version }}-${{ matrix.target }}
55+
56+
name: ${{ matrix.target }}
57+
steps:
58+
- uses: actions/checkout@v3
59+
- name: Set up Python ${{ matrix.py.version }}
60+
uses: actions/setup-python@v4
61+
with:
62+
python-version: ${{ matrix.py.version }}
63+
- uses: actions/cache@v3
64+
with:
65+
path: ~/.cache/pip
66+
key: ${{ env.cache-version }}-${{ env.run-matrix-combo }}-pip-${{ hashFiles('tox.ini', 'dev-constraints.txt') }}
67+
restore-keys: |
68+
${{ env.cache-version }}-${{ env.run-matrix-combo }}-pip
69+
- name: Install tox
70+
# Pin tox 3 because of https://github.com/rpkilby/tox-factor/issues/18
71+
run: pip install -U tox==3.27.1 tox-factor
72+
- name: Run tox factors ${{ matrix.target }}
73+
run: tox -f ${{ matrix.target }}

0 commit comments

Comments
 (0)