mirror of
https://github.com/saymrwulf/cryptography.git
synced 2026-05-14 20:37:55 +00:00
testing on every python version is necessary but we don't need to do it on all platforms. macos has the lowest concurrency so let's cut there.
100 lines
4.3 KiB
YAML
100 lines
4.3 KiB
YAML
name: CI
|
|
on:
|
|
pull_request: {}
|
|
push:
|
|
branches:
|
|
- master
|
|
- '*.*.x'
|
|
tags:
|
|
- '*.*'
|
|
- '*.*.*'
|
|
|
|
jobs:
|
|
macos:
|
|
runs-on: macos-latest
|
|
strategy:
|
|
matrix:
|
|
PYTHON:
|
|
- {VERSION: "2.7", TOXENV: "py27", EXTRA_CFLAGS: ""}
|
|
- {VERSION: "3.5", TOXENV: "py35", EXTRA_CFLAGS: ""}
|
|
- {VERSION: "3.8", TOXENV: "py38", EXTRA_CFLAGS: "-DUSE_OSRANDOM_RNG_FOR_TESTING"}
|
|
name: "Python ${{ matrix.PYTHON.VERSION }} on macOS"
|
|
steps:
|
|
- uses: actions/checkout@master
|
|
- name: Setup python
|
|
uses: actions/setup-python@v1
|
|
with:
|
|
python-version: ${{ matrix.PYTHON.VERSION }}
|
|
|
|
- run: python -m pip install tox requests coverage
|
|
|
|
- run: git clone https://github.com/google/wycheproof
|
|
|
|
- name: Download OpenSSL
|
|
run: |
|
|
python .github/workflows/download_openssl.py macos openssl-macos
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
- name: Tests
|
|
run: |
|
|
CRYPTOGRAPHY_SUPPRESS_LINK_FLAGS=1 \
|
|
LDFLAGS="${HOME}/openssl-macos/lib/libcrypto.a ${HOME}/openssl-macos/lib/libssl.a" \
|
|
CFLAGS="-I${HOME}/openssl-macos/include -Werror -Wno-error=deprecated-declarations -Wno-error=incompatible-pointer-types-discards-qualifiers -Wno-error=unused-function -Wno-error=unused-command-line-argument -mmacosx-version-min=10.10 -march=core2 $EXTRA_CFLAGS" \
|
|
tox -r -- --color=yes --wycheproof-root=wycheproof
|
|
env:
|
|
TOXENV: ${{ matrix.PYTHON.TOXENV }}
|
|
EXTRA_CFLAGS: ${{ matrix.PYTHON.EXTRA_CFLAGS }}
|
|
|
|
- name: Upload coverage
|
|
run: |
|
|
curl -o codecov.sh -f https://codecov.io/bash || curl -o codecov.sh -f https://codecov.io/bash || curl -o codecov.sh -f https://codecov.io/bash
|
|
bash codecov.sh -n "Python ${{ matrix.PYTHON.VERSION }} on macOS"
|
|
|
|
windows:
|
|
runs-on: windows-latest
|
|
strategy:
|
|
matrix:
|
|
WINDOWS:
|
|
- {ARCH: 'x86', WINDOWS: 'win32'}
|
|
- {ARCH: 'x64', WINDOWS: 'win64'}
|
|
PYTHON:
|
|
- {VERSION: "2.7", TOXENV: "py27", MSVC_VERSION: "2010", CL_FLAGS: ""}
|
|
- {VERSION: "3.5", TOXENV: "py35", MSVC_VERSION: "2019", CL_FLAGS: ""}
|
|
- {VERSION: "3.6", TOXENV: "py36", MSVC_VERSION: "2019", CL_FLAGS: ""}
|
|
- {VERSION: "3.7", TOXENV: "py37", MSVC_VERSION: "2019", CL_FLAGS: ""}
|
|
- {VERSION: "3.8", TOXENV: "py38", MSVC_VERSION: "2019", CL_FLAGS: "/D USE_OSRANDOM_RNG_FOR_TESTING"}
|
|
name: "Python ${{ matrix.PYTHON.VERSION }} on ${{ matrix.WINDOWS.WINDOWS }}"
|
|
steps:
|
|
- uses: actions/checkout@master
|
|
- name: Setup python
|
|
uses: actions/setup-python@v1
|
|
with:
|
|
python-version: ${{ matrix.PYTHON.VERSION }}
|
|
architecture: ${{ matrix.WINDOWS.ARCH }}
|
|
|
|
- name: Install MSVC for Python 2.7
|
|
run: |
|
|
Invoke-WebRequest -Uri https://download.microsoft.com/download/7/9/6/796EF2E4-801B-4FC4-AB28-B59FBF6D907B/VCForPython27.msi -OutFile VCForPython27.msi
|
|
Start-Process msiexec -Wait -ArgumentList @('/i', 'VCForPython27.msi', '/qn', 'ALLUSERS=1')
|
|
Remove-Item VCForPython27.msi -Force
|
|
shell: powershell
|
|
if: matrix.PYTHON.VERSION == '2.7'
|
|
- run: python -m pip install tox requests coverage
|
|
- name: Download OpenSSL
|
|
run: |
|
|
python .github/workflows/download_openssl.py windows openssl-${{ matrix.WINDOWS.WINDOWS }}-${{ matrix.PYTHON.MSVC_VERSION }}
|
|
echo "::set-env name=INCLUDE::C:/openssl-${{ matrix.WINDOWS.WINDOWS }}-${{ matrix.PYTHON.MSVC_VERSION }}/include;%INCLUDE%"
|
|
echo "::set-env name=LIB::C:/openssl-${{ matrix.WINDOWS.WINDOWS }}-${{ matrix.PYTHON.MSVC_VERSION }}/lib;%LIB%"
|
|
echo "::set-env name=CL::${{ matrix.PYTHON.CL_FLAGS }}"
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
- run: git clone https://github.com/google/wycheproof
|
|
|
|
- run: tox -r -- --color=yes --wycheproof-root=wycheproof
|
|
env:
|
|
TOXENV: ${{ matrix.PYTHON.TOXENV }}
|
|
|
|
- name: Upload coverage
|
|
run: |
|
|
curl -o codecov.sh -f https://codecov.io/bash || curl -o codecov.sh -f https://codecov.io/bash || curl -o codecov.sh -f https://codecov.io/bash
|
|
bash codecov.sh -n "Python ${{ matrix.PYTHON.VERSION }} on ${{ matrix.WINDOWS.WINDOWS }}"
|