Skip to content

Bump dawidd6/action-download-artifact from 12 to 15 #731

Bump dawidd6/action-download-artifact from 12 to 15

Bump dawidd6/action-download-artifact from 12 to 15 #731

Workflow file for this run

name: CI
on:
pull_request: {}
push:
branches:
- main
- '*.x'
tags:
- "*"
permissions:
contents: read
jobs:
linux:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
PYTHON:
- {VERSION: "3.13", NOXSESSION: "docs"}
- {VERSION: "3.13", NOXSESSION: "meta"}
- {VERSION: "3.13", NOXSESSION: "mypy"}
- {VERSION: "pypy-3.10", NOXSESSION: "tests"}
- {VERSION: "pypy-3.11", NOXSESSION: "tests"}
- {VERSION: "3.8", NOXSESSION: "tests"}
- {VERSION: "3.9", NOXSESSION: "tests"}
- {VERSION: "3.10", NOXSESSION: "tests"}
- {VERSION: "3.11", NOXSESSION: "tests"}
- {VERSION: "3.12", NOXSESSION: "tests"}
- {VERSION: "3.13", NOXSESSION: "tests"}
- {VERSION: "3.14", NOXSESSION: "tests"}
- {VERSION: "3.14t", NOXSESSION: "tests"}
- {VERSION: "3.14", NOXSESSION: "tests", NOTE: "system", SODIUM_INSTALL: "system"}
- {VERSION: "3.14", NOXSESSION: "tests", NOTE: "minimal", SODIUM_INSTALL_MINIMAL: "1"}
name: "Linux ${{ matrix.PYTHON.VERSION }} ${{ matrix.PYTHON.NOXSESSION }} ${{ matrix.PYTHON.NOTE }}"
steps:
- uses: actions/checkout@v6.0.1
- name: Setup python
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.PYTHON.VERSION }}
- name: Install nox
run: pip install nox
- name: Install libsodium (system install only)
run: |
wget --timeout=60 https://download.libsodium.org/libsodium/releases/LATEST.tar.gz || \
wget --timeout=60 https://download.libsodium.org/libsodium/releases/LATEST.tar.gz
tar zxvf LATEST.tar.gz
cd libsodium-*
./configure ${SODIUM_INSTALL_MINIMAL:+--enable-minimal}
make
make check
sudo make install
sudo ldconfig
env:
SODIUM_INSTALL_MINIMAL: ${{ matrix.PYTHON.SODIUM_INSTALL_MINIMAL }}
if: matrix.PYTHON.SODIUM_INSTALL == 'system'
- name: Run tests
run: LIBSODIUM_MAKE_ARGS="-j$(nproc)" nox -s ${{ matrix.python.NOXSESSION }}
env:
SODIUM_INSTALL_MINIMAL: ${{ matrix.PYTHON.SODIUM_INSTALL_MINIMAL }}
SODIUM_INSTALL: ${{ matrix.PYTHON.SODIUM_INSTALL }}
- uses: ./.github/actions/upload-coverage
macos:
runs-on: ${{ matrix.RUNNER }}
strategy:
matrix:
RUNNER:
- 'macos-15-intel'
- 'macos-latest'
PYTHON:
- {VERSION: "3.8", NOXSESSION: "tests"}
- {VERSION: "3.14", NOXSESSION: "tests"}
- {VERSION: "3.14t", NOXSESSION: "tests"}
- {VERSION: "3.14", NOXSESSION: "tests", NOTE: " (minimal build)", SODIUM_INSTALL_MINIMAL: "1"}
exclude:
- PYTHON: {VERSION: "3.8", NOXSESSION: "tests"}
RUNNER: macos-latest
name: "${{ matrix.RUNNER }} ${{ matrix.PYTHON.VERSION }} ${{ matrix.python.NOXSESSION }} ${{ matrix.PYTHON.NOTE }}"
steps:
- uses: actions/checkout@v6.0.1
- name: Setup python
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.PYTHON.VERSION }}
- name: Install nox
run: pip install nox
- name: Run tests
run: LIBSODIUM_MAKE_ARGS="-j$(sysctl -n hw.ncpu)" nox -s ${{ matrix.python.NOXSESSION }}
env:
SODIUM_INSTALL_MINIMAL: ${{ matrix.PYTHON.SODIUM_INSTALL_MINIMAL }}
- uses: ./.github/actions/upload-coverage
windows:
runs-on: ${{ matrix.WINDOWS.IMAGE }}
strategy:
matrix:
WINDOWS:
- {ARCH: 'x86', SODIUM_ARCH: 'Win32', IMAGE: "windows-latest"}
- {ARCH: 'x64', SODIUM_ARCH: 'x64', IMAGE: "windows-latest"}
- {ARCH: 'arm64', SODIUM_ARCH: 'ARM64', IMAGE: "windows-11-arm"}
PYTHON:
- {VERSION: "3.8", NOXSESSION: "tests", SODIUM_MSVC_VERSION: "v143"}
- {VERSION: "3.14", NOXSESSION: "tests", SODIUM_MSVC_VERSION: "v143"}
- {VERSION: "3.14t", NOXSESSION: "tests", SODIUM_MSVC_VERSION: "v143"}
exclude:
- WINDOWS: {ARCH: 'arm64', SODIUM_ARCH: 'ARM64', IMAGE: "windows-11-arm"}
PYTHON: {VERSION: "3.8", NOXSESSION: "tests", SODIUM_MSVC_VERSION: "v143"}
name: "Windows ${{ matrix.WINDOWS.ARCH }} ${{ matrix.PYTHON.VERSION }} ${{ matrix.PYTHON.NOXSESSION }}"
steps:
- uses: actions/checkout@v6.0.1
- name: Setup python
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.PYTHON.VERSION }}
architecture: ${{ matrix.WINDOWS.ARCH }}
- name: 'Extract libsodium libraries'
run: |
Expand-Archive src/libsodium-1.0.20-stable-msvc.zip -DestinationPath c:\
shell: powershell
- name: Install nox
run: pip install nox
- name: Run tests
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -no_logo -arch=${{ matrix.WINDOWS.ARCH }}
set PYNACL_SODIUM_LIBRARY_NAME=sodium
set PYNACL_SODIUM_STATIC=1
set SODIUM_INSTALL=system
set INCLUDE=C:/libsodium/include;%INCLUDE%
set LIB=C:/libsodium/${{ matrix.WINDOWS.SODIUM_ARCH }}/release/${{ matrix.PYTHON.SODIUM_MSVC_VERSION }}/static;%LIB%
nox -s ${{ matrix.PYTHON.NOXSESSION }}
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
shell: cmd
- uses: ./.github/actions/upload-coverage
all-green:
runs-on: ubuntu-latest
needs: [linux, macos, windows]
if: ${{ always() }}
timeout-minutes: 3
steps:
- uses: actions/checkout@v6.0.1
timeout-minutes: 3
with:
persist-credentials: false
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@v1.2.2
with:
jobs: ${{ toJSON(needs) }}
- name: Setup python
if: ${{ always() }}
uses: actions/setup-python@v6
with:
python-version: "3.13"
timeout-minutes: 3
- run: pip install coverage[toml]
if: ${{ always() }}
- name: Download coverage data
if: ${{ always() }}
uses: actions/download-artifact@v7.0.0
with:
pattern: coverage-data-*
merge-multiple: true
- name: Combine coverage and fail if it's <100%.
if: ${{ always() }}
id: combinecoverage
run: |
set +e
echo "## Coverage" >> $GITHUB_STEP_SUMMARY
coverage combine
coverage report -m --fail-under 100
COV_EXIT_CODE=$?
if [ $COV_EXIT_CODE -ne 0 ]; then
echo "🚨 Coverage failed. Under 100%" | tee -a $GITHUB_STEP_SUMMARY
fi
echo '```' >> $GITHUB_STEP_SUMMARY
coverage report -m >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
exit $COV_EXIT_CODE
- name: Upload HTML report
uses: actions/upload-artifact@v6
with:
name: coverage-html-report
path: htmlcov
if-no-files-found: ignore
if: ${{ failure() && steps.combinecoverage.outcome == 'failure' }}