| 1 |
name: Integration test |
| 2 |
|
| 3 |
on: [push, pull_request] |
| 4 |
|
| 5 |
jobs: |
| 6 |
build: |
| 7 |
runs-on: ${{ matrix.os }} |
| 8 |
strategy: |
| 9 |
matrix: |
| 10 |
python-version: [ 3.5, 3.6, 3.7, 3.8, 3.9, "3.10", "3.11", "3.12-dev" ] |
| 11 |
cffi: [ yes, no ] |
| 12 |
os: [ ubuntu-20.04 ] |
| 13 |
include: |
| 14 |
- python-version: "3.11" |
| 15 |
cffi: yes |
| 16 |
os: macos-12 |
| 17 |
- python-version: "3.11" |
| 18 |
cffi: no |
| 19 |
os: windows-latest |
| 20 |
- python-version: "3.11" |
| 21 |
cffi: yes |
| 22 |
os: windows-latest |
| 23 |
- python-version: "3.12-dev" |
| 24 |
cffi: no |
| 25 |
os: windows-latest |
| 26 |
- python-version: "3.12-dev" |
| 27 |
cffi: yes |
| 28 |
os: windows-latest |
| 29 |
- python-version: pypy2.7 |
| 30 |
cffi: no |
| 31 |
os: ubuntu-latest |
| 32 |
- python-version: pypy3.9 |
| 33 |
cffi: no |
| 34 |
os: ubuntu-latest |
| 35 |
env: |
| 36 |
CFLAGS: "-Wconversion" |
| 37 |
|
| 38 |
steps: |
| 39 |
- uses: actions/checkout@v3 |
| 40 |
|
| 41 |
- name: Set up Python ${{ matrix.python-version }} |
| 42 |
uses: actions/setup-python@v4 |
| 43 |
with: |
| 44 |
python-version: ${{ matrix.python-version }} |
| 45 |
|
| 46 |
- name: Display Python version |
| 47 |
run: python -c "from __future__ import print_function; import sys; print(sys.version)" |
| 48 |
|
| 49 |
- name: Install CFFI |
| 50 |
if: matrix.cffi == 'yes' |
| 51 |
run: pip install cffi |
| 52 |
|
| 53 |
- name: Install dependencies (testing only) |
| 54 |
run: | |
| 55 |
pip install -r requirements-test.txt |
| 56 |
|
| 57 |
- name: Install package |
| 58 |
run: | |
| 59 |
pip install -v . |
| 60 |
|
| 61 |
- name: Test |
| 62 |
shell: bash |
| 63 |
run: | |
| 64 |
if [[ -f .separate_namespace ]]; then |
| 65 |
python -m Cryptodome.SelfTest |
| 66 |
else |
| 67 |
python -m Crypto.SelfTest |
| 68 |
fi |
| 69 |
|
| 70 |
build_python_27: |
| 71 |
|
| 72 |
runs-on: ${{ matrix.os }} |
| 73 |
strategy: |
| 74 |
matrix: |
| 75 |
os: [ ubuntu-20.04, windows-latest] |
| 76 |
cffi: [ yes, no ] |
| 77 |
include: |
| 78 |
- os: ubuntu-20.04 |
| 79 |
container: python:2.7.18-buster |
| 80 |
container: |
| 81 |
image: ${{ matrix.container }} |
| 82 |
env: |
| 83 |
CFLAGS: "-Wconversion" |
| 84 |
|
| 85 |
steps: |
| 86 |
- uses: actions/checkout@v3 |
| 87 |
|
| 88 |
- name: Install Python 2 |
| 89 |
if: matrix.os == 'windows-latest' |
| 90 |
run: | |
| 91 |
choco install python2 |
| 92 |
|
| 93 |
- name: Install MSVC |
| 94 |
if: matrix.os == 'windows-latest' |
| 95 |
uses: ilammy/msvc-dev-cmd@v1 |
| 96 |
|
| 97 |
- name: Prepare environmental variables |
| 98 |
if: matrix.os == 'windows-latest' |
| 99 |
shell: bash |
| 100 |
run: | |
| 101 |
echo "DISTUTILS_USE_SDK=1" >> $GITHUB_ENV |
| 102 |
echo "MSSdk=1" >> $GITHUB_ENV |
| 103 |
echo "C:\\Python27;$(cat $GITHUB_PATH)" >> $GITHUB_PATH |
| 104 |
cat $GITHUB_PATH |
| 105 |
|
| 106 |
- name: Display Python version |
| 107 |
run: python -c "from __future__ import print_function; import sys; print(sys.version)" |
| 108 |
|
| 109 |
- name: Install CFFI |
| 110 |
if: matrix.cffi == 'yes' |
| 111 |
run: python -m pip install cffi |
| 112 |
|
| 113 |
- name: Install dependencies (testing only) |
| 114 |
run: | |
| 115 |
python -m pip install -r requirements-test.txt |
| 116 |
|
| 117 |
- name: Install package |
| 118 |
run: | |
| 119 |
python -m pip install -v . |
| 120 |
|
| 121 |
- name: Test |
| 122 |
shell: bash |
| 123 |
run: | |
| 124 |
if [[ -f .separate_namespace ]]; then |
| 125 |
python -m Cryptodome.SelfTest -v |
| 126 |
else |
| 127 |
python -m Crypto.SelfTest -v |
| 128 |
fi |
| 129 |
mypy: |
| 130 |
runs-on: ubuntu-latest |
| 131 |
steps: |
| 132 |
- uses: actions/checkout@v3 |
| 133 |
- name: Set up Python |
| 134 |
uses: actions/setup-python@v4 |
| 135 |
with: |
| 136 |
python-version: "3.x" |
| 137 |
- name: Install dependencies |
| 138 |
run: | |
| 139 |
pip install mypy -r requirements-test.txt |
| 140 |
- name: Test |
| 141 |
run: | |
| 142 |
mypy --enable-incomplete-feature=Unpack lib/ |
| 143 |
|
| 144 |
test_c_linux: |
| 145 |
runs-on: ubuntu-latest |
| 146 |
strategy: |
| 147 |
matrix: |
| 148 |
sse: [0, 1] |
| 149 |
arch: [x64, x32] |
| 150 |
steps: |
| 151 |
- uses: actions/checkout@v3 |
| 152 |
- name: Install dependencies |
| 153 |
run: | |
| 154 |
sudo apt-get update |
| 155 |
sudo apt-get install libc6-dev-i386 libubsan1 |
| 156 |
- name: Test Linux x32 and x64 |
| 157 |
run: | |
| 158 |
cd src/test |
| 159 |
mkdir build |
| 160 |
GCC_M32_TOOLCHAIN=${{ github.workspace }}/.github/workflows/gcc_m32_toolchain.txt |
| 161 |
EXTRA=$([ ${{ matrix.arch }} = x32 ] && echo "-DCMAKE_TOOLCHAIN_FILE=$GCC_M32_TOOLCHAIN" || true) |
| 162 |
cmake -B build -DSSE=${{ matrix.sse }} $EXTRA |
| 163 |
make -C build all test |
| 164 |
|
| 165 |
test_c_windows: |
| 166 |
runs-on: windows-latest |
| 167 |
strategy: |
| 168 |
matrix: |
| 169 |
arch: |
| 170 |
- x64 |
| 171 |
- win32 |
| 172 |
steps: |
| 173 |
- uses: actions/checkout@v3 |
| 174 |
- name: Set up Python "3.11" |
| 175 |
uses: actions/setup-python@v4 |
| 176 |
with: |
| 177 |
python-version: "3.11" |
| 178 |
- name: Install MSVC |
| 179 |
uses: ilammy/msvc-dev-cmd@v1 |
| 180 |
with: |
| 181 |
arch: ${{ matrix.arch }} |
| 182 |
- name: Test Windows 32 and 64 |
| 183 |
run: | |
| 184 |
cd src/test |
| 185 |
mkdir build |
| 186 |
cmake -B build -G "NMake Makefiles" |
| 187 |
cd build |
| 188 |
nmake all test |