-
Notifications
You must be signed in to change notification settings - Fork 3
113 lines (99 loc) · 3 KB
/
tests.yaml
File metadata and controls
113 lines (99 loc) · 3 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
name: Run tests
on:
workflow_dispatch:
inputs:
ml_ref:
description: "luxonis-ml version (branch/tag/SHA)"
required: true
default: main
train_ref:
description: "luxonis-train version (branch/tag/SHA)"
required: true
default: main
workflow_call:
inputs:
ml_ref:
description: "luxonis-ml version (branch/tag/SHA)"
required: true
type: string
train_ref:
description: "luxonis-train version (branch/tag/SHA)"
required: true
type: string
secrets:
GOOGLE_APPLICATION_CREDENTIALS:
description: "GCP service-account JSON"
required: true
CODECOV_TOKEN:
description: "Codecov upload token"
required: true
HUBAI_API_KEY:
description: "HubAI API key"
required: true
permissions:
pull-requests: write
contents: write
checks: write
jobs:
tests:
strategy:
fail-fast: false
matrix:
os: [ubuntu-t4-4core, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
repository: Luxonis/luxonis-train
ref: ${{ inputs.train_ref }}
path: luxonis-train
- name: Free Disk Space (Ubuntu)
if: matrix.os == 'ubuntu-latest'
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
large-packages: false
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: pip
- name: Install dependencies
working-directory: luxonis-train
run: pip install -e .[dev]
- name: Install specified luxonis-ml
shell: bash
env:
ML_REF: ${{ inputs.ml_ref }}
run: |
pip uninstall luxonis-ml -y
pip install \
"luxonis-ml[data,tracker] @ git+https://github.com/luxonis/luxonis-ml.git@${ML_REF}" \
--upgrade --force-reinstall
- name: Authenticate to Google Cloud
id: google-auth
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
create_credentials_file: true
export_environment_variables: true
token_format: access_token
- name: Run pytest
working-directory: luxonis-train
env:
LUXONISML_BUCKET: luxonis-test-bucket
HUBAI_API_KEY: ${{ secrets.HUBAI_API_KEY }}
run: pytest --cov --junitxml=junit.xml -o junit_family=legacy
- name: Upload test results to Codecov
if: matrix.os == 'ubuntu-t4-4core'
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
- name: Upload coverage results to Codecov
if: matrix.os == 'ubuntu-t4-4core'
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false