-
Notifications
You must be signed in to change notification settings - Fork 9
41 lines (38 loc) · 1.16 KB
/
vmsdk-test-python.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
name: VMSDK Python Test
on:
push:
branches:
- main
paths:
- 'src/python/**/*'
- '.github/workflows/vmsdk-test-python.yaml'
pull_request:
paths:
- 'src/python/**/*'
- '.github/workflows/vmsdk-test-python.yaml'
workflow_dispatch:
env:
VMSDK_PYTEST_DIR: 'vmsdk_pytest'
jobs:
vmsdk_pytest:
runs-on: [self-hosted, tdx-guest]
defaults:
run:
working-directory: ${{env.VMSDK_PYTEST_DIR}}
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
path: ${{env.VMSDK_PYTEST_DIR}}
- name: Run PyTest for VMSDK
run: |
set -ex
# Set the "PYTHONDONTWRITEBYTECODE" and "no:cacheprovider" to prevent
# generated some intermediate files by root. Othwerwise, these
# files will fail the action/checkout in the next round of running
# due to the permission issue.
sudo su -c "source setupenv.sh && \
pushd src/python/tests && \
export PYTHONDONTWRITEBYTECODE=1 && \
python3 -m pytest -p no:cacheprovider -v test_sdk.py && \
popd"