-
Notifications
You must be signed in to change notification settings - Fork 232
143 lines (141 loc) · 6.17 KB
/
ci.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
name: CI
on:
pull_request: {}
push:
branches:
- main
- '*.x'
tags:
- '*'
jobs:
linux:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
PYTHON:
- {VERSION: "3.12", TOXENV: "docs", COVERAGE: "false"}
- {VERSION: "3.12", TOXENV: "meta", COVERAGE: "false"}
- {VERSION: "3.12", TOXENV: "mypy", COVERAGE: "false"}
- {VERSION: "pypy-3.9", TOXENV: "pypy3"}
- {VERSION: "pypy-3.10", TOXENV: "pypy3"}
- {VERSION: "3.7", TOXENV: "py37"}
- {VERSION: "3.8", TOXENV: "py38"}
- {VERSION: "3.9", TOXENV: "py39"}
- {VERSION: "3.10", TOXENV: "py310"}
- {VERSION: "3.11", TOXENV: "py311"}
- {VERSION: "3.12", TOXENV: "py312"}
- {VERSION: "3.13-dev", TOXENV: "py313"}
- {VERSION: "3.13-dev", TOXENV: "py313", NOTE: "system", SODIUM_INSTALL: "system"}
- {VERSION: "3.13-dev", TOXENV: "py313", NOTE: "minimal", SODIUM_INSTALL_MINIMAL: "1"}
name: "Linux ${{ matrix.PYTHON.TOXENV }} ${{ matrix.PYTHON.NOTE }}"
steps:
- uses: actions/[email protected]
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.PYTHON.VERSION }}
- name: Install tox and coverage
run: pip install tox coverage
- 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)" tox
env:
TOXENV: ${{ matrix.PYTHON.TOXENV }}
SODIUM_INSTALL_MINIMAL: ${{ matrix.PYTHON.SODIUM_INSTALL_MINIMAL }}
SODIUM_INSTALL: ${{ matrix.PYTHON.SODIUM_INSTALL }}
- 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 || 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 }}${{ matrix.PYTHON.NOTE }} on macOS"
if: matrix.PYTHON.COVERAGE != 'false'
macos:
runs-on: ${{ matrix.RUNNER }}
strategy:
matrix:
RUNNER:
- 'macos-13'
- 'macos-latest'
PYTHON:
- {VERSION: "3.7", TOXENV: "py37"}
- {VERSION: "3.13-dev", TOXENV: "py313"}
- {VERSION: "3.13-dev", TOXENV: "py313", NOTE: " (minimal build)", SODIUM_INSTALL_MINIMAL: "1"}
exclude:
- PYTHON: {VERSION: "3.7", TOXENV: "py37"}
RUNNER: macos-latest
name: "Python ${{ matrix.PYTHON.VERSION }}${{ matrix.PYTHON.NOTE }} on ${{ matrix.RUNNER }}"
steps:
- uses: actions/[email protected]
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.PYTHON.VERSION }}
- name: Install tox and coverage
run: pip install tox coverage
- name: Run tests
run: LIBSODIUM_MAKE_ARGS="-j$(sysctl -n hw.ncpu)" tox
env:
TOXENV: ${{ matrix.PYTHON.TOXENV }}
SODIUM_INSTALL_MINIMAL: ${{ matrix.PYTHON.SODIUM_INSTALL_MINIMAL }}
- 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 || 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 }}${{ matrix.PYTHON.NOTE }} on macOS"
windows:
runs-on: windows-latest
strategy:
matrix:
WINDOWS:
- {ARCH: 'x86', SODIUM_ARCH: 'Win32'}
- {ARCH: 'x64', SODIUM_ARCH: 'x64'}
PYTHON:
- {VERSION: "3.7", TOXENV: "py37", SODIUM_MSVC_VERSION: "v142"}
- {VERSION: "3.8", TOXENV: "py38", SODIUM_MSVC_VERSION: "v142"}
- {VERSION: "3.9", TOXENV: "py39", SODIUM_MSVC_VERSION: "v142"}
- {VERSION: "3.10", TOXENV: "py310", SODIUM_MSVC_VERSION: "v142"}
- {VERSION: "3.11", TOXENV: "py311", SODIUM_MSVC_VERSION: "v142"}
- {VERSION: "3.12", TOXENV: "py312", SODIUM_MSVC_VERSION: "v142"}
- {VERSION: "3.13-dev", TOXENV: "py313", SODIUM_MSVC_VERSION: "v142"}
name: "Python ${{ matrix.PYTHON.VERSION }} on Windows ${{ matrix.WINDOWS.ARCH }}"
steps:
- uses: actions/[email protected]
- name: Setup python
uses: actions/setup-python@v5
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 tox and coverage
run: pip install tox coverage
- name: Run tests
run: |
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%
tox
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
env:
TOXENV: ${{ matrix.PYTHON.TOXENV }}
shell: cmd
- 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 || 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 Windows ${{ matrix.WINDOWS.ARCH }}"