-
Notifications
You must be signed in to change notification settings - Fork 1
42 lines (32 loc) · 1.2 KB
/
pytest.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
42
# 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: Run PyTest
on:
push:
branches:
- main
pull_request:
jobs:
run_pytest:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build docker image
run: docker build -f Dockerfile.pytest -t pytest_image .
- name: Create directory for coverage report
run: mkdir -p ${{ github.workspace }}/pytest_reports
- name: Set coverage report directory permissions
run: chmod -R 777 ${{ github.workspace }}/pytest_reports
- name: Run docker image
run: docker run --rm -v ${{ github.workspace }}/pytest_reports:/home/lsst/consdb/pytest_reports -e PYTEST_ADDOPTS="--color=yes" pytest_image
- name: Upload test report
uses: actions/upload-artifact@v4
with:
name: pytest_report
path: pytest_reports/pytest_report.html
- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: coverage_report
path: pytest_reports/htmlcov