-
-
Notifications
You must be signed in to change notification settings - Fork 6
63 lines (52 loc) · 1.56 KB
/
pr-tests.yaml
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
56
57
58
59
60
61
62
63
name: PR Tests
on:
workflow_call:
pull_request:
branches:
- dev
- main
workflow_dispatch:
inputs:
none:
description: "Run Tests Manually"
required: false
concurrency:
group: syft-${{ github.event_name == 'pull_request' && format('{0}-{1}', github.workflow, github.event.pull_request.number) || github.workflow_ref }}
cancel-in-progress: true
jobs:
pr-tests:
strategy:
max-parallel: 99
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ["3.12", "3.11", "3.10"]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install pip packages
run: |
python -m pip install --upgrade pip
pip install -U uv tox tox-uv pytest
uv --version
- name: Get uv cache dir
id: pip-cache
shell: bash
run: |
echo "dir=$(uv cache dir)" >> $GITHUB_OUTPUT
- name: Load github cache
uses: actions/cache@v4
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-uv-py${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}
restore-keys: |
${{ runner.os }}-uv-py${{ matrix.python-version }}-
- name: Run unit tests
env:
TOX_PYTHON: python${{ matrix.python-version }}
run: |
tox -e syft.test.unit