Merge pull request #10 from nimasmi/chore/upgrade-python-and-django #64
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI tests | |
on: [push] | |
env: | |
poetry-version: 1.2.0 | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python "3.9" | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.9" | |
- uses: pre-commit/[email protected] | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11"] | |
django-version: ["3.2.9", "4.1.3", "4.2"] | |
exclude: | |
- django-version: "3.2" | |
python-version: "3.11" | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Cache Poetry virtual env | |
uses: actions/cache@v2 | |
with: | |
path: .venv | |
key: ${{ runner.os }}-python-${{ matrix.python-version }}-django-${{ matrix.django-version }}-${{ hashFiles('pyproject.toml') }} | |
- name: Run image | |
uses: abatilo/[email protected] | |
with: | |
poetry-version: ${{ env.poetry-version }} | |
- name: Install Python packages | |
run: | | |
poetry config virtualenvs.in-project true | |
poetry install | |
poetry add django==${{ matrix.django-version }} | |
poetry show django | |
test: | |
runs-on: ubuntu-latest | |
needs: [build, lint] | |
strategy: | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11"] | |
django-version: ["3.2.9", "4.1.3", "4.2"] | |
exclude: | |
- django-version: "3.2" | |
python-version: "3.11" | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Cache Poetry virtual env | |
uses: actions/cache@v2 | |
env: | |
cache-name: cache-poetry-virtualenv | |
with: | |
path: .venv | |
key: ${{ runner.os }}-python-${{ matrix.python-version }}-django-${{ matrix.django-version }}-${{ hashFiles('pyproject.toml') }} | |
- name: Run image | |
uses: abatilo/[email protected] | |
with: | |
poetry-version: ${{ env.poetry-version }} | |
- name: Test | |
run: | | |
poetry run python -m django --version | |
poetry run python runtests.py |