-
Notifications
You must be signed in to change notification settings - Fork 11
86 lines (70 loc) · 2.11 KB
/
Copy pathpython-package.yml
File metadata and controls
86 lines (70 loc) · 2.11 KB
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Python package
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10"]
steps:
# Clean out runner data we don't use, should free up ~15 GB
- run: df -h
- name: "node-cleanup"
run: |
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL
sudo docker image prune --all --force
sudo docker builder prune -a
- run: df -h
- uses: actions/checkout@v4
- name: Cache tox dir
id: cache-tox
uses: actions/cache@v4
env:
cache-name: cache-tox-data
with:
path: .tox
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('pyproject.toml') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- if: ${{ steps.cache-tox-data.outputs.cache-hit != 'true' }}
name: List the state of tox
continue-on-error: true
run: ls -lha .tox/py310/
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip' # caching pip dependencies
- name: Install python dependencies
run: |
python -m pip install tox
- name: Run ruff format check
run: |
tox -e ruff_checkformat
- name: Run ruff check
run: |
tox -e ruff_check
- name: Fetch dataset
run: |
tox -e trainingdata
- name: Run tox unit tests
run: |
tox -e py310
- name: Run tox security check
run: |
tox -e bandit
- name: Run inference
run: |
tox -e inference_CI
- name: Run inference_multi_CI
run: |
tox -e inference_multi_CI