-
Notifications
You must be signed in to change notification settings - Fork 0
105 lines (89 loc) · 3.14 KB
/
Copy pathrun_pytest.yml
File metadata and controls
105 lines (89 loc) · 3.14 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
name: Run pytest
on:
pull_request:
permissions:
checks: write
pull-requests: write
jobs:
install_and_test:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
container:
image: ghcr.io/dune-daq/nightly-release-alma9:development_v5
steps:
- name: Set up dev nightly
if: ${{ !cancelled() }}
run: |
mkdir nightly
cd nightly
source /cvmfs/dunedaq.opensciencegrid.org/setup_dunedaq.sh
setup_dbt latest_v5
dbt-create -n last_fddaq
cd NFD_DEV*
source env.sh
dbt-build
dbt-workarea-env
- name: Install daqpytools
if: success()
run: |
cd nightly/NFD_DEV* || true
source env.sh
python -m pip install --upgrade pip
cd sourcecode
echo "Cloning daqpytools"
git clone https://github.com/${{ github.event.pull_request.head.repo.owner.login }}/daqpytools.git -b ${{ github.head_ref }} || git clone https://github.com/DUNE-DAQ/daqpytools.git
echo "Entering daqpytools"
cd daqpytools
echo "Installing"
pip install .[test]
echo "DAQPYTOOLS_DIR=$(pwd)" >> $GITHUB_ENV
- name: Test with pytest/pytest-cov
if: success()
run: |
cd nightly/NFD_DEV* || true
source env.sh
cd sourcecode/daqpytools || true
pip install pytest pytest-cov
pytest --junitxml=junit/test-results.xml --cov=daqpytools --cov-report=html
- name: Publish JUnit test report
uses: mikepenz/action-junit-report@v5
if: ${{ !cancelled() }}
with:
report_paths: '${{ env.DAQPYTOOLS_DIR }}/junit/test-results.xml'
# - name: Deploy HTML coverage to GitHub Pages
# if: ${{ !cancelled() }}
# uses: peaceiris/actions-gh-pages@v3
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# publish_dir: ${{ env.DAQPYTOOLS_DIR }}/htmlcov/
# destination_dir: coverage/${{ github.ref_name }} # This adds the branch name to the URL
# publish_branch: gh-pages
# - name: Comment on PR
# if: ${{ !cancelled() }}
# uses: actions/github-script@v7
# with:
# script: |
# github.rest.issues.createComment({
# issue_number: context.issue.number,
# owner: context.repo.owner,
# repo: context.repo.repo,
# body: 'Coverage report: https://dune-daq.github.io/daqpytools/coverage/${{ github.ref_name }}/index.html'
# })
# - name: Upload JUnit test report
# if: ${{ !cancelled() }}
# uses: actions/upload-artifact@v4
# with:
# name: junit-report
# path: ${{ env.DAQPYTOOLS_DIR }}/junit/test-results.xml
# if-no-files-found: error
# retention-days: 7
- name: Upload coverage report (HTML)
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: html-coverage-report
path: ${{ env.DAQPYTOOLS_DIR }}/htmlcov/
if-no-files-found: error
retention-days: 7