-
Notifications
You must be signed in to change notification settings - Fork 41
55 lines (49 loc) · 1.89 KB
/
JOB_tests.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
44
45
46
47
48
49
50
51
52
53
54
55
# Run tests
name: tests
run-name: Tests
on:
workflow_call:
permissions:
contents: read
jobs:
test:
name: "Run Testing OS: ${{ matrix.os }} Python: ${{ matrix.python-version }}"
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.9", "3.10", "3.11", "3.12"]
runs-on: ${{ matrix.os }}
steps:
- name: Free Disk space
shell: bash
if: matrix.os == 'ubuntu-latest'
run: |
sudo rm -rf /usr/local/lib/android # will release about 10 GB if you don't need Android
sudo rm -rf /usr/share/dotnet # will release about 20GB if you don't need .NET
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ github.head_ref || github.ref }}
- name: Install Python ${{ matrix.python-version }}
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies with retry
uses: nick-invision/retry@7152eba30c6575329ac0576536151aca5a72780e
with:
timeout_minutes: 10
max_attempts: 3
command: |
bash -c "pip install poetry pytest && \
poetry install --no-interaction --no-root -vvv --all-extras && \
poetry install --no-interaction --no-root --all-extras -vvv && \
pip install wheel && \
pip install --upgrade setuptools && \
pip install --editable '.[test,ml,medical,dev, ocv]'"
- name: Run pytest
shell: bash # Stops Windows hosts from using PowerShell
run: |
python -m pytest