Skip to content

Commit d00baff

Browse files
Merge pull request #19 from DevoInc/SKIP/feature/test-workflow
Python environments testing
2 parents a509383 + bc111b2 commit d00baff

File tree

2 files changed

+23
-45
lines changed

2 files changed

+23
-45
lines changed

.github/workflows/test-tox.yml

Lines changed: 15 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,27 @@
1-
# Source: https://github.com/marketplace/actions/install-poetry-action
1+
name: Test
22

3-
name: Test with tox
4-
5-
# Test on push
63
on:
74
push
85

96
jobs:
107
test:
118
runs-on: ubuntu-latest
9+
strategy:
10+
max-parallel: 2
11+
matrix:
12+
python-version: [ '3.7', '3.8', '3.9', '3.10', '3.11' ]
1213
steps:
13-
#----------------------------------------------
14-
# check-out repo and set-up python
15-
#----------------------------------------------
16-
- name: Check out repository
17-
uses: actions/checkout@v2
18-
- name: Set up python
19-
id: setup-python
20-
uses: actions/setup-python@v2
14+
- uses: actions/checkout@v3
15+
- uses: actions/setup-python@v4
2116
with:
22-
python-version: 3.9
23-
#----------------------------------------------
24-
# ----- install & configure poetry -----
25-
#----------------------------------------------
26-
- name: Install Poetry
27-
uses: snok/install-poetry@v1
17+
python-version: ${{ matrix.python-version }}
18+
- uses: snok/install-poetry@v1
2819
with:
29-
virtualenvs-create: true
3020
virtualenvs-in-project: true
31-
installer-parallel: true
32-
33-
#----------------------------------------------
34-
# load cached venv if cache exists
35-
#----------------------------------------------
36-
- name: Load cached venv
37-
id: cached-poetry-dependencies
38-
uses: actions/cache@v2
39-
with:
40-
path: .venv
41-
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
42-
#----------------------------------------------
43-
# install dependencies if cache does not exist
44-
#----------------------------------------------
4521
- name: Install dependencies
46-
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
47-
run: poetry install --no-interaction --no-root
48-
#----------------------------------------------
49-
# install your root project, if required
50-
#----------------------------------------------
51-
- name: Install library
52-
run: poetry install --no-interaction
53-
#----------------------------------------------
54-
# run test suite
55-
#----------------------------------------------
56-
- name: Run tests
57-
run: poetry run tox
22+
run: |
23+
pip install --upgrade pip
24+
pip install tox tox-gh-actions
25+
poetry install --no-interaction
26+
- name: Run tox
27+
run: tox

tox.ini

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@ envlist = python3.7, py{38, 39, 310, 311}
33
skip_missing_interpreters = true
44
isolated_build = true
55

6+
[gh-actions]
7+
python =
8+
3.7: python3.7
9+
3.8: py38
10+
3.9: py39
11+
3.10: py310
12+
3.11: py311
13+
614
[testenv]
715
whitelist_externals = poetry
816
commands_pre =

0 commit comments

Comments
 (0)