]> git.phdru.name Git - mimedecode.git/blob - .github/workflows/run-tests.yaml
4db3d8e3fdfd19450016c426111e6cdb194216a4
[mimedecode.git] / .github / workflows / run-tests.yaml
1 name: Run tests
2
3 on: [push, pull_request]
4
5 jobs:
6   run-tests:
7
8     strategy:
9       matrix:
10         python-version: ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "pypy-2.7", "pypy-3.7"]
11
12     name: Python ${{ matrix.python-version }}
13     runs-on: ubuntu-latest
14
15     steps:
16
17       # Setup Python/pip
18       - uses: actions/checkout@v2
19       - uses: actions/setup-python@v4
20         with:
21           python-version: ${{ matrix.python-version }}
22       - name: Cache pip
23         uses: actions/cache@v3
24         with:
25           # This path is specific to Linux/Unix
26           path: ~/.cache/pip
27           key: ${{ runner.os }}-pip
28
29       # Setup tox
30       - name: Install dependencies
31         run: |
32           python --version
33           python -m pip install --upgrade pip setuptools wheel
34           pip --version
35           pip install --upgrade virtualenv tox
36       - name: Set TOXENV
37         run: |
38           import os, sys
39           if hasattr(sys, 'pypy_version_info'):
40             toxenv = 'pypy'
41           else:
42             pyver = '%d%d' % tuple(sys.version_info[:2])
43             toxenv = 'py%s' % pyver
44           with open(os.environ['GITHUB_ENV'], 'a') as f:
45             f.write('TOXENV=' + toxenv + '\n')
46         shell: python
47
48
49       - name: Run tox targets for ${{ matrix.python-version }}
50         run: |
51           python -c "import os; print(os.environ['TOXENV'])"
52           tox --version
53           tox