File tree Expand file tree Collapse file tree 3 files changed +64
-4
lines changed Expand file tree Collapse file tree 3 files changed +64
-4
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,9 @@ outputs:
27
27
module :
28
28
description : Path to PKCS#11 module
29
29
value : ${{ steps.install-result.outputs.module }}
30
+ module2 :
31
+ description : Path to alternative PKCS#11 module ('multi' only)
32
+ value : ${{ steps.install-result.outputs.module2 }}
30
33
runs :
31
34
using : " composite"
32
35
steps :
35
38
with :
36
39
python-version : ${{ inputs.python-version }}
37
40
- uses : ./.github/actions/install-softhsm
38
- if : inputs.pkcs11-platform == 'softhsm'
41
+ if : inputs.pkcs11-platform == 'softhsm' || inputs.pkcs11-platform == 'multi'
39
42
id : softhsm
40
43
with :
41
44
os : ${{ inputs.os }}
45
48
- uses : ./.github/actions/install-opencryptoki
46
49
# only run opencryptoki tests on ubuntu
47
50
# (macos and windows don't seem to be supported)
48
- if : inputs.pkcs11-platform == 'opencryptoki'
51
+ if : inputs.pkcs11-platform == 'opencryptoki' || inputs.pkcs11-platform == 'multi'
49
52
id : opencryptoki
50
53
with :
51
54
os : ${{ inputs.os }}
60
63
echo "module=${{ steps.opencryptoki.outputs.module }}" >> "$GITHUB_OUTPUT"
61
64
elif [[ "$PLATFORM" == 'softhsm' ]]; then
62
65
echo "module=${{ steps.softhsm.outputs.module }}" >> "$GITHUB_OUTPUT"
66
+ elif [[ "$PLATFORM" == 'multi' ]]; then
67
+ echo "module=${{ steps.softhsm.outputs.module }}" >> "$GITHUB_OUTPUT"
68
+ echo "module2=${{ steps.opencryptoki.outputs.module }}" >> "$GITHUB_OUTPUT"
63
69
else
64
70
echo "$PLATFORM is not a valid PKCS#11 platform choice"
65
71
exit 1
Original file line number Diff line number Diff line change 50
50
with :
51
51
name : coverage-${{ strategy.job-index }}
52
52
path : " *-coverage.xml"
53
+ pytest-coverage-multilib :
54
+ runs-on : ubuntu-latest
55
+ steps :
56
+ - name : Acquire sources
57
+ uses : actions/checkout@v4
58
+ - uses : ./.github/actions/test-setup
59
+ id : setup
60
+ with :
61
+ os : ubuntu-latest
62
+ pkcs11-platform : multi
63
+ token-label : ${{ env.PKCS11_TOKEN_LABEL }}
64
+ token-so-pin : ${{ env.PKCS11_TOKEN_SO_PIN }}
65
+ token-user-pin : ${{ env.PKCS11_TOKEN_PIN }}
66
+ python-version : " 3.12"
67
+ dependency-group : coverage
68
+ - name : Run tests
69
+ run : uv run pytest -v --cov=pkcs11 --cov-branch --cov-report=xml:multilib-coverage.xml tests/test_multilib.py
70
+ env :
71
+ PKCS11_MODULE : ${{ steps.setup.outputs.module }}
72
+ PKCS11_MODULE2 : ${{ steps.setup.outputs.module2 }}
73
+ - name : Stash coverage report
74
+ uses : actions/upload-artifact@v4
75
+ with :
76
+ name : coverage-multilib
77
+ path : " *-coverage.xml"
53
78
codecov-upload :
54
79
permissions :
55
80
actions : write
71
96
directory : ./reports/
72
97
flags : unittests
73
98
env_vars : OS,PYTHON
74
- name : codecov-umbrella
99
+ name : codecov-umbrella
Original file line number Diff line number Diff line change 11
11
PKCS11_TOKEN_PIN : " 1234"
12
12
PKCS11_TOKEN_SO_PIN : " 5678"
13
13
jobs :
14
- run :
14
+ tests :
15
15
runs-on : ${{ matrix.os }}
16
16
strategy :
17
17
# Our test suite is pretty fast, so fail-fast: false allows for better troubleshooting.
54
54
run : uv run pytest -v
55
55
env :
56
56
PKCS11_MODULE : ${{ steps.setup.outputs.module }}
57
+ multilib-tests :
58
+ runs-on : ubuntu-latest
59
+ strategy :
60
+ fail-fast : false
61
+ matrix :
62
+ python-version :
63
+ - " 3.9"
64
+ - " 3.10"
65
+ - " 3.11"
66
+ - " 3.12"
67
+ - " 3.13"
68
+ steps :
69
+ - name : Acquire sources
70
+ uses : actions/checkout@v4
71
+ - uses : ./.github/actions/test-setup
72
+ id : setup
73
+ with :
74
+ os : ubuntu-latest
75
+ pkcs11-platform : multi
76
+ token-label : ${{ env.PKCS11_TOKEN_LABEL }}
77
+ token-so-pin : ${{ env.PKCS11_TOKEN_SO_PIN }}
78
+ token-user-pin : ${{ env.PKCS11_TOKEN_PIN }}
79
+ python-version : ${{ matrix.python-version }}
80
+ dependency-group : testing
81
+ - name : Run tests
82
+ run : uv run pytest -v tests/test_multilib.py
83
+ env :
84
+ PKCS11_MODULE : ${{ steps.setup.outputs.module }}
85
+ PKCS11_MODULE2 : ${{ steps.setup.outputs.module2 }}
You can’t perform that action at this time.
0 commit comments