-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (83 loc) · 2.78 KB
/
tests.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
94
name: Tests (callable)
on:
workflow_call:
inputs:
python-version:
description: Python version to use
type: string
default: '3.10'
toxenv:
description: Name of the tox environment
type: string
default: 'py310'
runner:
description: Where to run
type: string
default: 'ubuntu-latest'
hps-version:
description: HPS version to test against
type: string
default: 'latest-dev'
hps-feature:
description: HPS Feature to test against (only for latest-dev version)
type: string
default: 'main'
jobs:
tests:
name: Tests and coverage
runs-on: ${{ inputs.runner }}
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ inputs.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}
- uses: extractions/netrc@v2
with:
machine: github.com
username: pyansys-ci-bot
password: ${{ secrets.PYANSYS_CI_BOT_PACKAGE_TOKEN }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools tox tox-gh-actions
mkdir docker-compose-artifact
- name: Start HPS services
id: hps-services
uses: ansys/pyhps/.github/actions/hps_services@main
with:
token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }}
ghcr-username: ${{ secrets.PYANSYS_CI_BOT_USERNAME }}
ghcr-token: ${{ secrets.PYANSYS_CI_BOT_PACKAGE_TOKEN }}
version: ${{ inputs.hps-version }}
feature: ${{ inputs.hps-feature }}
- name: Test with tox
run: tox -e ${{ inputs.toxenv }}-coverage
env:
HPS_TEST_URL: ${{ steps.hps-services.outputs.url }}
HPS_TEST_USERNAME: repadmin
HPS_TEST_PASSWORD: repadmin
- name: Upload coverage results
uses: actions/upload-artifact@v4
if: ${{ inputs.python-version == '3.10' }}
with:
name: coverage-html
path: .cov/html
retention-days: 7
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
if: ${{ inputs.python-version == '3.10' }}
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: '**/test*.xml'
- name: Publish Test Report
uses: mikepenz/action-junit-report@v5
if: always()
with:
report_paths: '**/test*.xml'
check_name: Test Report ${{ inputs.runner }}:${{ inputs.python-version }}
detailed_summary: true
include_passed: true
- name: Publish services info to summary
if: success() || failure()
run: cat build_info.md >> $GITHUB_STEP_SUMMARY