Skip to content

Commit

Permalink
use tox in github action (#35)
Browse files Browse the repository at this point in the history
also cache pip
  • Loading branch information
alexdej authored Jun 13, 2024
1 parent 69cb065 commit f1fb109
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
20 changes: 7 additions & 13 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python package
name: unit tests

on:
push:
Expand All @@ -16,22 +16,16 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.8, 3.9, '3.10', 3.11, 3.12]
python-version: ["3.8","3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# Stop the build if there are any lint errors or warnings
flake8 . --count --show-source --max-line-length=127 --statistics
- name: Run tests
run: |
python tests.py
cache: pip
- name: Install requirements
run: pip install -r requirements.txt
- name: Run tox
run: tox -e py
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
tox
flake8

0 comments on commit f1fb109

Please sign in to comment.