forked from divio/django-multisite-plus
-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (41 loc) · 1.52 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: Tox tests
on: [push, pull_request]
jobs:
test:
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.continue-on-error }}
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
django: [32, 42]
continue-on-error: [true]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ format('test-py{0}-django{1}', matrix.python-version, matrix.django) }}
restore-keys: |
${{ runner.os }}-pip-${{ format('test-py{0}-django{1}', matrix.python-version, matrix.django) }}
- name: Cache tox
uses: actions/cache@v3
with:
path: .tox
key: ${{ runner.os }}-tox-${{ format('test-{{py{0}-django{1}}}', matrix.python-version, matrix.django) }}-${{ hashFiles('setup.cfg') }}
restore-keys: |
${{ runner.os }}-tox-${{ format('test-{{py{0}-django{1}}}', matrix.python-version, matrix.django) }}-
- name: Install dependencies
run: |
sudo apt-get install gettext
python -m pip install --upgrade pip setuptools tox>4 tox-docker
- name: Test with tox
env:
TOX_ENV: ${{ format('test-py{0}-django{1}', matrix.python-version, matrix.django) }}
run: |
tox -e$TOX_ENV