Add support for Solaris and illumos #37
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: [push, pull_request] | |
jobs: | |
Pre-Commit: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.9 | |
- name: Set Cache Key | |
run: echo "PY=$(python --version --version | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV | |
- uses: actions/cache@v2 | |
with: | |
path: ~/.cache/pre-commit | |
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}|${{ hashFiles('.pre-commit-hooks/*') }} | |
- name: Install Dependencies | |
run: | | |
python -m pip install pre-commit | |
pre-commit install --install-hooks | |
- name: Run Pre-Commit | |
run: | | |
pre-commit run --show-diff-on-failure --color=always --all-files | |
PyLint: | |
runs-on: ubuntu-latest | |
needs: Pre-Commit | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python 3.7 For Nox | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.7 | |
- name: Install Nox | |
run: | | |
python -m pip install --upgrade pip | |
pip install nox | |
- name: Install Lint Requirements | |
run: | | |
nox --force-color -e lint --install-only | |
- name: Run PyLint | |
env: | |
SKIP_REQUIREMENTS_INSTALL: YES | |
run: | | |
nox --force-color -e lint | |
Docs: | |
runs-on: ubuntu-latest | |
needs: Pre-Commit | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python 3.7 For Nox | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.7 | |
- name: Install Nox | |
run: | | |
python -m pip install --upgrade pip | |
pip install nox | |
- name: Install Doc Requirements | |
run: | | |
nox --force-color -e docs --install-only | |
- name: Build Docs | |
env: | |
SKIP_REQUIREMENTS_INSTALL: YES | |
run: | | |
nox --force-color -e docs | |
Linux: | |
runs-on: ubuntu-latest | |
needs: Pre-Commit | |
timeout-minutes: 15 | |
strategy: | |
fail-fast: false | |
max-parallel: 10 | |
matrix: | |
python-version: | |
- "3.5" | |
- "3.6" | |
- "3.7" | |
- "3.8" | |
- "3.9" | |
- "3.10" | |
pytest-version: | |
- "~=6.0.0" | |
- "~=6.1.0" | |
- "~=6.2.0" | |
- ">=7.0.0rc1" | |
exclude: | |
- {"python-version": "3.5", "pytest-version": "~=6.2.0"} | |
- {"python-version": "3.5", "pytest-version": ">=7.0.0rc1"} | |
- {"python-version": "3.10", "pytest-version": "~=6.0.0"} | |
- {"python-version": "3.10", "pytest-version": "~=6.1.0"} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Nox | |
run: | | |
python -m pip install --upgrade pip | |
pip install nox 'pytest${{ matrix.pytest-version }}' | |
- name: Install Test Requirements | |
env: | |
PYTEST_VERSION_REQUIREMENT: pytest${{ matrix.pytest-version }} | |
run: | | |
nox --force-color -e tests-3 --install-only | |
- name: Test | |
env: | |
SKIP_REQUIREMENTS_INSTALL: YES | |
run: | | |
nox --force-color -e tests-3 -- -vv tests/ | |
- name: Gather CodeCov Info | |
if: always() | |
id: codecov-info | |
run: | | |
echo ::set-output name=flag-python-version::$(python -c "import sys; print('Py{}{}'.format(*sys.version_info))") | |
echo ::set-output name=flag-pytest-version::$(python -c "import pytest; print('PyTest{}{}'.format(*pytest.__version__.split('.')))") | |
echo ::set-output name=flag-runner-os::$(python -c "print('${{ runner.os }}'.replace('-latest', ''))") | |
echo ::set-output name=uploader-url::$(python -c "print('https://uploader.codecov.io/latest/codecov-linux')") | |
echo ::set-output name=uploader-name::$(python -c "print('codecov-linux')") | |
- name: Create CodeCov Flags | |
if: always() | |
id: codecov | |
run: | | |
echo ::set-output name=flags::$(python -c "print(','.join(['${{ steps.codecov-info.outputs.flag-runner-os }}', '${{ steps.codecov-info.outputs.flag-python-version }}', '${{ steps.codecov-info.outputs.flag-pytest-version }}']))") | |
echo ::set-output name=report-name::$(python -c "print('-'.join(['${{ steps.codecov-info.outputs.flag-runner-os }}', '${{ steps.codecov-info.outputs.flag-python-version }}', '${{ steps.codecov-info.outputs.flag-pytest-version }}']))") | |
- name: Download Code Coverage Tool | |
if: always() | |
shell: bash | |
run: | | |
if [ "$(which curl)x" == "x" ]; then | |
echo "Failed to find the 'curl' binary" | |
exit 0 | |
fi | |
if [ "$(which gpg)x" == "x" ]; then | |
echo "Failed to find the 'gpg' binary" | |
exit 0 | |
fi | |
if [ "$(which shasum)x" == "x" ]; then | |
echo "Failed to find the 'shasum' binary" | |
exit 0 | |
fi | |
if [ ! -x codecov-linux ]; then | |
n=0 | |
until [ "$n" -ge 5 ] | |
do | |
if curl --max-time 30 -L ${{ steps.codecov-info.outputs.uploader-url }} --output ${{ steps.codecov-info.outputs.uploader-name }}; then | |
break | |
fi | |
n=$((n+1)) | |
sleep 15 | |
done | |
n=0 | |
until [ "$n" -ge 5 ] | |
do | |
if curl --max-time 30 -L ${{ steps.codecov-info.outputs.uploader-url }}.SHA256SUM --output ${{ steps.codecov-info.outputs.uploader-name }}.SHA256SUM; then | |
break | |
fi | |
n=$((n+1)) | |
sleep 15 | |
done | |
n=0 | |
until [ "$n" -ge 5 ] | |
do | |
if curl --max-time 30 -L ${{ steps.codecov-info.outputs.uploader-url }}.SHA256SUM.sig --output ${{ steps.codecov-info.outputs.uploader-name }}.SHA256SUM.sig; then | |
break | |
fi | |
n=$((n+1)) | |
sleep 15 | |
done | |
n=0 | |
until [ "$n" -ge 5 ] | |
do | |
if curl --max-time 30 -L https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --import; then | |
break | |
fi | |
n=$((n+1)) | |
sleep 15 | |
done | |
gpg --verify ${{ steps.codecov-info.outputs.uploader-name }}.SHA256SUM.sig ${{ steps.codecov-info.outputs.uploader-name }}.SHA256SUM && \ | |
shasum -a 256 -c ${{ steps.codecov-info.outputs.uploader-name }}.SHA256SUM && \ | |
chmod +x ${{ steps.codecov-info.outputs.uploader-name }} || exit 0 | |
fi | |
- name: Upload Project Code Coverage | |
if: always() | |
shell: bash | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
REPORT_FLAGS: ${{ steps.codecov-flags.outputs.flags }},src | |
REPORT_NAME: ${{ runner.os }}-Py${{ matrix.python-version }}-src | |
REPORT_PATH: artifacts/coverage-project.xml | |
run: | | |
if [ -x ${{ steps.codecov-info.outputs.uploader-name }} ]; then | |
n=0 | |
until [ "$n" -ge 5 ] | |
do | |
if ./${{ steps.codecov-info.outputs.uploader-name }} -R $(pwd) -n "${REPORT_NAME}" -f "${REPORT_PATH}" -F "${REPORT_FLAGS}"; then | |
break | |
fi | |
n=$((n+1)) | |
sleep 15 | |
done | |
fi | |
- name: Upload Tests Code Coverage | |
if: always() | |
shell: bash | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
REPORT_FLAGS: ${{ steps.codecov-flags.outputs.flags }},tests | |
REPORT_NAME: ${{ runner.os }}-Py${{ matrix.python-version }}-tests | |
REPORT_PATH: artifacts/coverage-tests.xml | |
run: | | |
if [ -x ${{ steps.codecov-info.outputs.uploader-name }} ]; then | |
n=0 | |
until [ "$n" -ge 5 ] | |
do | |
if ./${{ steps.codecov-info.outputs.uploader-name }} -R $(pwd) -n "${REPORT_NAME}" -f "${REPORT_PATH}" -F "${REPORT_FLAGS}"; then | |
break | |
fi | |
n=$((n+1)) | |
sleep 15 | |
done | |
fi | |
- name: Upload Logs | |
if: always() | |
uses: actions/upload-artifact@main | |
with: | |
name: runtests-${{ steps.codecov.outputs.report-name }}.log | |
path: artifacts/runtests-*.log | |
Windows: | |
runs-on: windows-latest | |
needs: Pre-Commit | |
timeout-minutes: 40 | |
strategy: | |
fail-fast: false | |
max-parallel: 10 | |
matrix: | |
python-version: | |
- "3.6" | |
- "3.7" | |
- "3.8" | |
- "3.9" | |
- "3.10" | |
pytest-version: | |
- "~=6.2.0" | |
- ">=7.0.0rc1" | |
exclude: | |
- {"python-version": "3.10", "pytest-version": "~=6.0.0"} | |
- {"python-version": "3.10", "pytest-version": "~=6.1.0"} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Nox | |
run: | | |
python -m pip install --upgrade pip | |
pip install nox 'pytest${{ matrix.pytest-version }}' | |
- name: Install Test Requirements | |
shell: bash | |
env: | |
PYTEST_VERSION_REQUIREMENT: pytest${{ matrix.pytest-version }} | |
run: | | |
export PATH="/C/Program Files (x86)/Windows Kits/10/bin/10.0.18362.0/x64;$PATH" | |
nox --force-color -e tests-3 --install-only | |
- name: Test | |
shell: bash | |
env: | |
SKIP_REQUIREMENTS_INSTALL: YES | |
run: | | |
export PATH="/C/Program Files (x86)/Windows Kits/10/bin/10.0.18362.0/x64;$PATH" | |
nox --force-color -e tests-3 -- -vv tests/ | |
- name: Gather CodeCov Info | |
if: always() | |
id: codecov-info | |
shell: bash | |
run: | | |
echo ::set-output name=flag-python-version::$(python -c "import sys; print('Py{}{}'.format(*sys.version_info))") | |
echo ::set-output name=flag-pytest-version::$(python -c "import pytest; print('PyTest{}{}'.format(*pytest.__version__.split('.')))") | |
echo ::set-output name=flag-runner-os::$(python -c "print('${{ runner.os }}'.replace('-latest', ''))") | |
echo ::set-output name=uploader-url::$(python -c "print('https://uploader.codecov.io/latest/windows/codecov.exe')") | |
echo ::set-output name=uploader-name::$(python -c "print('codecov.exe')") | |
- name: Create CodeCov Flags | |
if: always() | |
id: codecov | |
run: | | |
echo ::set-output name=flags::$(python -c "print(','.join(['${{ steps.codecov-info.outputs.flag-runner-os }}', '${{ steps.codecov-info.outputs.flag-python-version }}', '${{ steps.codecov-info.outputs.flag-pytest-version }}']))") | |
echo ::set-output name=report-name::$(python -c "print('-'.join(['${{ steps.codecov-info.outputs.flag-runner-os }}', '${{ steps.codecov-info.outputs.flag-python-version }}', '${{ steps.codecov-info.outputs.flag-pytest-version }}']))") | |
- name: Download Code Coverage Tool | |
if: always() | |
shell: powershell | |
run: | | |
If (-not(Test-Path -Path ./${{ steps.codecov-info.outputs.uploader-name }})) { | |
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls, [Net.SecurityProtocolType]::Tls11, [Net.SecurityProtocolType]::Tls12, [Net.SecurityProtocolType]::Ssl3 | |
[Net.ServicePointManager]::SecurityProtocol = "Tls, Tls11, Tls12, Ssl3" | |
$ProgressPreference = 'SilentlyContinue' | |
Invoke-WebRequest -Uri https://keybase.io/codecovsecurity/pgp_keys.asc -OutFile codecov.asc | |
gpg.exe --import codecov.asc | |
Invoke-WebRequest -Uri ${{ steps.codecov-info.outputs.uploader-url }} -Outfile ${{ steps.codecov-info.outputs.uploader-name }} | |
Invoke-WebRequest -Uri ${{ steps.codecov-info.outputs.uploader-url }}.SHA256SUM -Outfile ${{ steps.codecov-info.outputs.uploader-name }}.SHA256SUM | |
Invoke-WebRequest -Uri ${{ steps.codecov-info.outputs.uploader-url }}.SHA256SUM.sig -Outfile ${{ steps.codecov-info.outputs.uploader-name }}.SHA256SUM.sig | |
gpg.exe --verify ${{ steps.codecov-info.outputs.uploader-name }}.SHA256SUM.sig ${{ steps.codecov-info.outputs.uploader-name }}.SHA256SUM | |
If ($(Compare-Object -ReferenceObject $(($(certUtil -hashfile ${{ steps.codecov-info.outputs.uploader-name }} SHA256)[1], "${{ steps.codecov-info.outputs.uploader-name }}") -join " ") -DifferenceObject $(Get-Content ${{ steps.codecov-info.outputs.uploader-name }}.SHA256SUM)).length -eq 0) { | |
echo "SHASUM verified" | |
} Else { | |
exit 0 | |
} | |
} | |
- name: Upload Project Code Coverage | |
if: always() | |
shell: bash | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
REPORT_FLAGS: ${{ steps.codecov-flags.outputs.flags }},src | |
REPORT_NAME: ${{ runner.os }}-Py${{ matrix.python-version }}-src | |
REPORT_PATH: artifacts/coverage-project.xml | |
run: | | |
if [ -x ${{ steps.codecov-info.outputs.uploader-name }} ]; then | |
n=0 | |
until [ "$n" -ge 5 ] | |
do | |
if ./${{ steps.codecov-info.outputs.uploader-name }} -R $(pwd) -n "${REPORT_NAME}" -f "${REPORT_PATH}" -F "${REPORT_FLAGS}"; then | |
break | |
fi | |
n=$((n+1)) | |
sleep 15 | |
done | |
fi | |
- name: Upload Tests Code Coverage | |
if: always() | |
shell: bash | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
REPORT_FLAGS: ${{ steps.codecov-flags.outputs.flags }},tests | |
REPORT_NAME: ${{ runner.os }}-Py${{ matrix.python-version }}-tests | |
REPORT_PATH: artifacts/coverage-tests.xml | |
run: | | |
if [ -x ${{ steps.codecov-info.outputs.uploader-name }} ]; then | |
n=0 | |
until [ "$n" -ge 5 ] | |
do | |
if ./${{ steps.codecov-info.outputs.uploader-name }} -R $(pwd) -n "${REPORT_NAME}" -f "${REPORT_PATH}" -F "${REPORT_FLAGS}"; then | |
break | |
fi | |
n=$((n+1)) | |
sleep 15 | |
done | |
fi | |
- name: Upload Logs | |
if: always() | |
uses: actions/upload-artifact@main | |
with: | |
name: runtests-${{ steps.codecov.outputs.report-name }}.log | |
path: artifacts/runtests-*.log | |
macOS: | |
runs-on: macOS-latest | |
needs: Pre-Commit | |
timeout-minutes: 40 | |
strategy: | |
fail-fast: false | |
max-parallel: 10 | |
matrix: | |
python-version: | |
- "3.6" | |
- "3.7" | |
- "3.8" | |
- "3.9" | |
- "3.10" | |
pytest-version: | |
- "~=6.2.0" | |
- ">=7.0.0rc1" | |
exclude: | |
- {"python-version": "3.10", "pytest-version": "~=6.0.0"} | |
- {"python-version": "3.10", "pytest-version": "~=6.1.0"} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Nox | |
run: | | |
python -m pip install --upgrade pip | |
pip install nox 'pytest${{ matrix.pytest-version }}' | |
- name: Install Test Requirements | |
env: | |
PYTEST_VERSION_REQUIREMENT: pytest${{ matrix.pytest-version }} | |
run: | | |
nox --force-color -e tests-3 --install-only | |
- name: Test | |
env: | |
SKIP_REQUIREMENTS_INSTALL: YES | |
run: | | |
nox --force-color -e tests-3 -- -vv tests/ | |
- name: Gather CodeCov Info | |
if: always() | |
id: codecov-info | |
run: | | |
echo ::set-output name=flag-python-version::$(python -c "import sys; print('Py{}{}'.format(*sys.version_info))") | |
echo ::set-output name=flag-pytest-version::$(python -c "import pytest; print('PyTest{}{}'.format(*pytest.__version__.split('.')))") | |
echo ::set-output name=flag-runner-os::$(python -c "print('${{ runner.os }}'.replace('-latest', ''))") | |
echo ::set-output name=uploader-url::$(python -c "print('https://uploader.codecov.io/latest/codecov-macos')") | |
echo ::set-output name=uploader-name::$(python -c "print('codecov-macos')") | |
- name: Create CodeCov Flags | |
if: always() | |
id: codecov | |
run: | | |
echo ::set-output name=flags::$(python -c "print(','.join(['${{ steps.codecov-info.outputs.flag-runner-os }}', '${{ steps.codecov-info.outputs.flag-python-version }}', '${{ steps.codecov-info.outputs.flag-pytest-version }}']))") | |
echo ::set-output name=report-name::$(python -c "print('-'.join(['${{ steps.codecov-info.outputs.flag-runner-os }}', '${{ steps.codecov-info.outputs.flag-python-version }}', '${{ steps.codecov-info.outputs.flag-pytest-version }}']))") | |
- name: Download Code Coverage Tool | |
if: always() | |
shell: bash | |
run: | | |
if [ "$(which curl)x" == "x" ]; then | |
echo "Failed to find the 'curl' binary" | |
exit 0 | |
fi | |
if [ "$(which gpg)x" == "x" ]; then | |
echo "Failed to find the 'gpg' binary" | |
exit 0 | |
fi | |
if [ "$(which shasum)x" == "x" ]; then | |
echo "Failed to find the 'shasum' binary" | |
exit 0 | |
fi | |
if [ ! -x codecov-linux ]; then | |
n=0 | |
until [ "$n" -ge 5 ] | |
do | |
if curl --max-time 30 -L ${{ steps.codecov-info.outputs.uploader-url }} --output ${{ steps.codecov-info.outputs.uploader-name }}; then | |
break | |
fi | |
n=$((n+1)) | |
sleep 15 | |
done | |
n=0 | |
until [ "$n" -ge 5 ] | |
do | |
if curl --max-time 30 -L ${{ steps.codecov-info.outputs.uploader-url }}.SHA256SUM --output ${{ steps.codecov-info.outputs.uploader-name }}.SHA256SUM; then | |
break | |
fi | |
n=$((n+1)) | |
sleep 15 | |
done | |
n=0 | |
until [ "$n" -ge 5 ] | |
do | |
if curl --max-time 30 -L ${{ steps.codecov-info.outputs.uploader-url }}.SHA256SUM.sig --output ${{ steps.codecov-info.outputs.uploader-name }}.SHA256SUM.sig; then | |
break | |
fi | |
n=$((n+1)) | |
sleep 15 | |
done | |
n=0 | |
until [ "$n" -ge 5 ] | |
do | |
if curl --max-time 30 -L https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --import; then | |
break | |
fi | |
n=$((n+1)) | |
sleep 15 | |
done | |
gpg --verify ${{ steps.codecov-info.outputs.uploader-name }}.SHA256SUM.sig ${{ steps.codecov-info.outputs.uploader-name }}.SHA256SUM && \ | |
shasum -a 256 -c ${{ steps.codecov-info.outputs.uploader-name }}.SHA256SUM && \ | |
chmod +x ${{ steps.codecov-info.outputs.uploader-name }} || exit 0 | |
fi | |
- name: Upload Project Code Coverage | |
if: always() | |
shell: bash | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
REPORT_FLAGS: ${{ steps.codecov-flags.outputs.flags }},src | |
REPORT_NAME: ${{ runner.os }}-Py${{ matrix.python-version }}-src | |
REPORT_PATH: artifacts/coverage-project.xml | |
run: | | |
if [ -x ${{ steps.codecov-info.outputs.uploader-name }} ]; then | |
n=0 | |
until [ "$n" -ge 5 ] | |
do | |
if ./${{ steps.codecov-info.outputs.uploader-name }} -R $(pwd) -n "${REPORT_NAME}" -f "${REPORT_PATH}" -F "${REPORT_FLAGS}"; then | |
break | |
fi | |
n=$((n+1)) | |
sleep 15 | |
done | |
fi | |
- name: Upload Tests Code Coverage | |
if: always() | |
shell: bash | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
REPORT_FLAGS: ${{ steps.codecov-flags.outputs.flags }},tests | |
REPORT_NAME: ${{ runner.os }}-Py${{ matrix.python-version }}-tests | |
REPORT_PATH: artifacts/coverage-tests.xml | |
run: | | |
if [ -x ${{ steps.codecov-info.outputs.uploader-name }} ]; then | |
n=0 | |
until [ "$n" -ge 5 ] | |
do | |
if ./${{ steps.codecov-info.outputs.uploader-name }} -R $(pwd) -n "${REPORT_NAME}" -f "${REPORT_PATH}" -F "${REPORT_FLAGS}"; then | |
break | |
fi | |
n=$((n+1)) | |
sleep 15 | |
done | |
fi | |
- name: Upload Logs | |
if: always() | |
uses: actions/upload-artifact@main | |
with: | |
name: runtests-${{ steps.codecov.outputs.report-name }}.log | |
path: artifacts/runtests-*.log | |
Build: | |
runs-on: ubuntu-latest | |
needs: | |
- Docs | |
- PyLint | |
- Linux | |
- Windows | |
- macOS | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.9 | |
- name: Install Nox | |
run: | | |
python -m pip install nox | |
- name: Build a binary wheel and a source tarball | |
run: | | |
nox -e build | |
- name: Publish distribution 📦 to Test PyPI | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.TEST_PYPI_TOKEN }} | |
repository_url: https://test.pypi.org/legacy/ | |
print_hash: true |