Skip to content

Commit

Permalink
Modify lint_and_test.yml to use tox-gh-actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Talmaj committed Sep 15, 2024
1 parent e9a2c6c commit bd457f0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 10 deletions.
23 changes: 13 additions & 10 deletions .github/workflows/lint_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,40 @@ on: [pull_request]
jobs:
test:
runs-on: ubuntu-latest
container:
image: divio/multi-python
strategy:
matrix:
python-version: [ '3.9', '3.10', '3.11', '3.12' ]

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: 3.9
python-version: ${{ matrix.python-version }}

- name: Cache dependencies
- name: Cache dependencies ${{ matrix.python-version }}
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.python-version }}-
${{ runner.os }}-pip-
- name: Install dependencies
- name: Install dependencies ${{ matrix.python-version }}
run: |
pip install -r requirements.txt
pip install tox tox-gh-actions
- name: Run tests
- name: Run tests ${{ matrix.python-version }}
run: |
bash download_fixtures.sh
tox
- name: Upload coverage to GitHub Artifacts
- name: Upload coverage to GitHub Artifacts ${{ matrix.python-version }}
uses: actions/upload-artifact@v4
with:
name: coverage
name: coverage-${{ matrix.python-version }}
path: htmlcov/
7 changes: 7 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@
[tox]
envlist = clean,py39,py310,py311,py312

[gh-actions]
python =
3.9: py39
3.10: py310
3.11: py311
3.12: py312

[testenv]
passenv =
CIRCLE*
Expand Down

0 comments on commit bd457f0

Please sign in to comment.