Skip to content

Commit

Permalink
Test multiple Python versions in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ml-evs committed Oct 9, 2023
1 parent 8b80d41 commit 836e215
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 88 deletions.
17 changes: 15 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,22 @@ jobs:
tests:
runs-on: ubuntu-latest

strategy:
fail-fast: false
max-parallel: 4
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v3
with:
submodules: true

- name: Set up Python 3.9

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: '3.9'
python-version: ${{matrix.python-version }}
cache: 'pip'
cache-dependency-path: |
requirements*.txt
Expand All @@ -37,6 +44,7 @@ jobs:
poetry install --all-extras
- name: Run linting
if: matrix.python-version == 3.9
run: |
poetry run pre-commit run --all-files
Expand All @@ -45,10 +53,12 @@ jobs:
poetry run pytest
- name: Build docs
if: matrix.python-version == 3.9
run : |
poetry run mkdocs build
- name: Lock dependencies and prepare deployment
if: matrix.python-version == 3.9
run: |
# Azure expects to find the app, requirements and any static files at the top-level
# so we need to do some tweaks here to massage the repo into that format
Expand All @@ -60,6 +70,7 @@ jobs:
ls -al
- name: Upload artifact for deployment
if: matrix.python-version == 3.9
uses: actions/upload-artifact@v3
with:
name: PASCal - test
Expand All @@ -71,12 +82,14 @@ jobs:
!tests/
- name: Fix permissions # followng https://github.com/actions/upload-pages-artifact?tab=readme-ov-file#file-permissions
if: matrix.python-version == 3.9
run: |
chmod -c -R +rX "site/" | while read line; do
echo "::warning title=Invalid file permissions automatically fixed::$line"
done
- name: Upload docs artifact
if: matrix.python-version == 3.9
uses: actions/upload-pages-artifact@v2
with:
path: site
Expand Down
89 changes: 5 additions & 84 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ license = "MIT"
authors = [ "Matthew Cliffe <[email protected]>", ]
classifiers = [
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering",
]
Expand All @@ -22,7 +25,7 @@ repository = "https://github.com/MJCliffe/PASCal"
packages = [{ include = "PASCal", from = "src" }]

[tool.poetry.dependencies]
python = "^3.8"
python = "^3.9"
Flask = "*"
Jinja2 = "*"
numpy = "*"
Expand Down

0 comments on commit 836e215

Please sign in to comment.