-
Notifications
You must be signed in to change notification settings - Fork 157
150 lines (133 loc) · 4.62 KB
/
run_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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
name: Run tests
on: [push, pull_request]
jobs:
run-tests:
name: Run tests
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
include:
- os: macos-latest
python-version: "3.10"
openssl-version: "3"
- os: macos-latest
python-version: "3.11"
openssl-version: "3"
exclude:
# test hangs on these combination
- os: windows-latest
python-version: "3.8"
- os: windows-latest
python-version: "3.9"
- os: windows-latest
python-version: "3.10"
- os: windows-latest
python-version: "3.11"
runs-on: ${{ matrix.os }}
env:
liboqs_version: '0.7.2'
nettle_version: nettle_3.8.1_release_20220727
steps:
- name: Checkout asyncssh
uses: actions/checkout@v3
with:
path: asyncssh
- name: Checkout liboqs
if: ${{ runner.os != 'macOS' }}
uses: actions/checkout@v3
with:
repository: open-quantum-safe/liboqs
ref: ${{ env.liboqs_version }}
path: liboqs
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: |
asyncssh/setup.py
asyncssh/tox.ini
- name: Set up ccache for liboqs (Linux)
uses: hendrikmuhs/ccache-action@v1.2
if: ${{ runner.os == 'Linux' }}
with:
key: liboqs-cache-${{ matrix.os }}
- name: Install Linux dependencies
if: ${{ runner.os == 'Linux' }}
run: sudo apt install -y --no-install-recommends libnettle8 libsodium-dev libssl-dev libkrb5-dev ssh cmake ninja-build
- name: Install macOS dependencies
if: ${{ runner.os == 'macOS' }}
run: brew install nettle liboqs libsodium openssl
- name: Provide OpenSSL 3
if: ${{ runner.os == 'macOS' && matrix.openssl-version == '3' }}
run: echo "/usr/local/opt/openssl@3/bin" >> $GITHUB_PATH
- name: Install nettle (Windows)
if: ${{ runner.os == 'Windows' }}
shell: pwsh
run: |
curl -fLO https://github.com/ShiftMediaProject/nettle/releases/download/${{ env.nettle_version }}/libnettle_${{ env.nettle_version }}_msvc17.zip
Expand-Archive libnettle_${{ env.nettle_version }}_msvc17.zip nettle
cp nettle\bin\x64\*.dll "$env:Python_ROOT_DIR"
- name: Install liboqs (Linux)
if: ${{ runner.os == 'Linux' }}
working-directory: liboqs
run: |
cmake -GNinja -Bbuild . -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_SHARED_LIBS=ON -DOQS_BUILD_ONLY_LIB=ON -DOQS_DIST_BUILD=ON -DCMAKE_C_COMPILER_LAUNCHER=ccache
cmake --build build
sudo cmake --install build
- name: Initialize MSVC environment
uses: ilammy/msvc-dev-cmd@v1
- name: Install liboqs (Windows)
if: ${{ runner.os == 'Windows' }}
shell: pwsh
working-directory: liboqs
run: |
cmake -GNinja -Bbuild . -DBUILD_SHARED_LIBS=ON -DOQS_BUILD_ONLY_LIB=ON -DOQS_DIST_BUILD=ON
cmake --build build
cp build\bin\oqs.dll "$env:Python_ROOT_DIR"
- name: Install Python dependencies
run: pip install tox
- name: Run tests
shell: python
working-directory: asyncssh
run: |
import os, sys, platform, subprocess
V = sys.version_info
p = platform.system().lower()
subprocess.run(
['tox', 'run', '-e', f'py{V.major}{V.minor}-{p}', '--', '-ra'],
check=True)
- name: Upload coverage data
uses: actions/upload-artifact@v3
with:
name: coverage
path: asyncssh/.coverage.*
retention-days: 1
report-coverage:
name: Report coverage
runs-on: ubuntu-latest
needs: run-tests
if: ${{ always() }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.7"
- uses: actions/download-artifact@v3
with:
name: coverage
- name: Install dependencies
run: |
sudo apt install -y sqlite3
pip install tox
- name: Report coverage
run: |
shopt -s nullglob
for f in .coverage.*-windows; do
sqlite3 "$f" "update file set path = replace(path, '\\', '/');"
done
tox -e report
- uses: codecov/codecov-action@v3
with:
files: coverage.xml