-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (38 loc) · 1.44 KB
/
python-app.yml
File metadata and controls
49 lines (38 loc) · 1.44 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
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Python application
on:
push:
pull_request:
branches: [ "master" ]
workflow_dispatch:
env:
CUDA_VISIBLE_DEVICES: 1
permissions:
contents: read
jobs:
build:
runs-on: self-hosted
steps:
- uses: actions/checkout@v3
- name: setup
run: |
source ~/.bashrc
echo "PYXALIGN_CI_TEST_DATA_DIR=$PYXALIGN_CI_TEST_DATA_DIR" >> $GITHUB_ENV
echo "CONTAINERS_CONF=/local/containers.conf" >> $GITHUB_ENV
- name: build container
run: podman build -t localhost/pyxalign-actions-runner-image .
- name: start container and run pytest
run: |
echo $PYXALIGN_CI_TEST_DATA_DIR
podman run --rm --env DISPLAY \
--security-opt label=type:container_runtime_t --network host \
--device nvidia.com/gpu=all \
-v="$HOME/.Xauthority:/root/.Xauthority:rw" \
--env PYXALIGN_CI_TEST_DATA_DIR=$PYXALIGN_CI_TEST_DATA_DIR \
-v=$PYXALIGN_CI_TEST_DATA_DIR:$PYXALIGN_CI_TEST_DATA_DIR \
pyxalign-actions-runner-image:latest bash -c \
"pip install pytest && cd pyxalign && pytest -s"
- name: container cleanup
run: |
podman rmi pyxalign-actions-runner-image