-
Notifications
You must be signed in to change notification settings - Fork 13
38 lines (38 loc) · 1.25 KB
/
run-unittest.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
name: tests
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", 3.11, 3.12, 3.13]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install M2Crypto # TODO remove when tests are updated
pip install cryptography
pip install -e .
- name: Run tests
run: python3 test_.py
# As we support both python-magic and file-magic, try them one by one.
- name: Test python-magic
run: python3 test_.py TestMime.test_libmagic
- name: Uninstall python-magic
run: pip uninstall python-magic -y
- name: Test libmagic missing
id: should_fail
run: python3 test_.py TestMime.test_libmagic
continue-on-error: true
- name: Check on failures
if: steps.should_fail.outcome != 'failure'
run: exit 1
- name: Install file-magic
run: pip install file-magic
- name: Test file-magic
run: python3 test_.py TestMime.test_libmagic