-
Notifications
You must be signed in to change notification settings - Fork 13
93 lines (80 loc) · 2.91 KB
/
tripy-l0.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
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
name: Tripy CI
on:
pull_request:
branches:
- main
types: [synchronize, opened, reopened, ready_for_review]
paths: ['tripy/**']
env:
REGISTRY: ghcr.io
DEFAULT_IMAGE: ghcr.io/nvidia/tensorrt-incubator/tripy:latest
NEW_TEST_IMAGE: test-image:latest
jobs:
tripy-l0:
if: github.event.pull_request.draft == false
runs-on: tripy-self-hosted
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
local_container:
- 'tripy/Dockerfile'
- 'tripy/pyproject.toml'
- if: steps.filter.outputs.local_container == 'true'
run: echo "l0_image=${{ env.NEW_TEST_IMAGE }}" >> "$GITHUB_ENV"
- if: steps.filter.outputs.local_container != 'true'
run: echo "l0_image=${{ env.DEFAULT_IMAGE }}" >> "$GITHUB_ENV"
# Login against a Docker registry
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build new container
if: steps.filter.outputs.local_container == 'true'
uses: docker/build-push-action@v6
with:
context: tripy/
tags: ${{ env.NEW_TEST_IMAGE }}
push: false
- name: Pull latest container
if: steps.filter.outputs.local_container != 'true'
run: docker pull ${{ env.l0_image }}
- name: build-docs
uses: addnab/docker-run-action@v3
with:
image: ${{ env.l0_image }}
options: --gpus all -v ${{ github.workspace }}/tripy:/tripy
run: |
python3 docs/generate_rsts.py
sphinx-build build/doc_sources build/docs -c docs/ -j 4 -W -n
- name: Run tests
uses: addnab/docker-run-action@v3
with:
image: ${{ env.l0_image }}
options: --gpus all -v ${{ github.workspace }}/tripy:/tripy
run: |
pytest --cov=tripy/ --cov-config=.coveragerc tests/ -v -m "not l1" -n 4 --durations=15 --ignore tests/performance
- name: Run performance benchmarks
uses: addnab/docker-run-action@v3
with:
image: ${{ env.l0_image }}
options: --gpus all -v ${{ github.workspace }}/tripy:/tripy
run: |
pytest tests/performance -v -m "not l1" --benchmark-warmup=on --benchmark-json benchmark.json
- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
tool: 'pytest'
output-file-path: ${{ github.workspace }}/tripy/benchmark.json
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: true
# Show alert with commit comment on detecting possible performance regression
alert-threshold: '105%'
comment-on-alert: true
fail-on-alert: true
gh-pages-branch: benchmarks