Skip to content

Commit a078e89

Browse files
committed
Use latest actions and simplify variables/steps in GitHub Actions workflows.
1 parent 2018e3a commit a078e89

1 file changed

Lines changed: 67 additions & 70 deletions

File tree

.github/workflows/lint-test-cover-docs-build-upload.yml

Lines changed: 67 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -4,71 +4,68 @@ on:
44
jobs:
55
manylinux:
66
runs-on: ubuntu-latest
7-
container: quay.io/pypa/manylinux2014_x86_64
87
strategy:
98
matrix:
109
python:
11-
- {version: '3.7', version-abi: 'cp37', version-abi-suffix: 'cp37m'}
12-
- {version: '3.8', version-abi: 'cp38', version-abi-suffix: 'cp38'}
13-
- {version: '3.9', version-abi: 'cp39', version-abi-suffix: 'cp39'}
14-
- {version: '3.10', version-abi: 'cp310', version-abi-suffix: 'cp310'}
15-
- {version: '3.11', version-abi: 'cp311', version-abi-suffix: 'cp311'}
16-
name: Python ${{ matrix.python.version }} with ABI ${{ matrix.python.version-abi }} for manylinux2014_x86_64
10+
- {version: '3.7', abi: 'cp37'}
11+
- {version: '3.8', abi: 'cp38'}
12+
- {version: '3.9', abi: 'cp39'}
13+
- {version: '3.10', abi: 'cp310'}
14+
- {version: '3.11', abi: 'cp311'}
15+
name: Python ${{ matrix.python.version }} with ABI ${{ matrix.python.abi }} for manylinux2014_x86_64
1716
env:
18-
WHEELNAME: rbcl-${{ github.ref_name }}-${{ matrix.python.version-abi }}-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64
17+
WHEELNAME: rbcl-${{ github.ref_name }}-${{ matrix.python.abi }}-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64
1918
steps:
20-
- uses: actions/checkout@v3
21-
- name: Install development dependencies.
22-
run: |
23-
yum -y install wget libffi-devel
19+
- uses: actions/checkout@v4
20+
- name: Install Python.
21+
uses: actions/setup-python@v4
22+
with:
23+
python-version: ${{ matrix.python.version }}
24+
architecture: x64
2425
- name: Download libsodium source tree archive.
2526
run: |
2627
wget https://download.libsodium.org/libsodium/releases/libsodium-1.0.18.tar.gz
2728
mv libsodium-1.0.18.tar.gz src/rbcl/libsodium.tar.gz
28-
- name: Install Python.
29-
run: |
30-
/opt/python/${{ matrix.python.version-abi }}-${{ matrix.python.version-abi-suffix }}/bin/python -m pip install virtualenv
31-
/opt/python/${{ matrix.python.version-abi }}-${{ matrix.python.version-abi-suffix }}/bin/python -m virtualenv .venv
3229
- name: Install Python dependencies for build process.
3330
run: |
34-
.venv/bin/pip install -U pip .[build]
31+
pip install .[build]
3532
- name: Build wheel file.
3633
run: |
3734
mkdir tmpwheelhouse
38-
LIBSODIUM_MAKE_ARGS="-j$(nproc)" .venv/bin/python -m build --wheel
35+
LIBSODIUM_MAKE_ARGS="-j$(nproc)" python -m build --wheel
3936
mv dist/rbcl*.whl tmpwheelhouse
4037
mkdir wheelhouse
4138
mv tmpwheelhouse/rbcl*.whl wheelhouse/
4239
cp build/lib*/rbcl/_sodium.py src/rbcl/_sodium.py
4340
- name: Test wheel installation.
4441
run: |
45-
.venv/bin/pip install -f wheelhouse --no-index --force-reinstall --no-dependencies rbcl
42+
pip install -f wheelhouse --no-index --force-reinstall --no-dependencies rbcl
4643
- name: Lint and test module (and compiled libsodium shared library file).
4744
run: |
48-
.venv/bin/pip install -U .[lint,test]
49-
.venv/bin/python -m pylint rbcl src/rbcl/_sodium.tmpl src/rbcl/_sodium_build.py --disable=duplicate-code # Check against linting rules.
50-
.venv/bin/python src/rbcl/rbcl.py -v # Run doctests.
51-
.venv/bin/python -m pytest # Run tests.
45+
pip install -U .[lint,test]
46+
python -m pylint rbcl src/rbcl/_sodium.tmpl src/rbcl/_sodium_build.py --disable=duplicate-code # Check against linting rules.
47+
python src/rbcl/rbcl.py -v # Run doctests.
48+
python -m pytest # Run tests.
5249
- name: Publish coverage results.
5350
run: |
54-
.venv/bin/pip install -U .[coveralls]
55-
.venv/bin/python -m coveralls --service=github # Submit to coveralls.
51+
pip install -U .[coveralls]
52+
python -m coveralls --service=github # Submit to coveralls.
5653
if: matrix.python.version == '3.11'
5754
env:
5855
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5956
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
6057
- name: Test auto-generation of documentation.
6158
run: |
62-
.venv/bin/pip install -U .[docs]
59+
pip install -U .[docs]
6360
cd docs
64-
../.venv/bin/sphinx-apidoc -f -E --templatedir=_templates -o _source .. ../src/rbcl/_sodium_build.py
65-
make html SPHINXBUILD='../.venv/bin/sphinx-build'
61+
sphinx-apidoc -f -E --templatedir=_templates -o _source .. ../src/rbcl/_sodium_build.py
62+
make html
6663
cd ..
6764
- name: Upload wheel file.
6865
run: |
6966
mkdir rbcl-wheelhouse
7067
mv wheelhouse/rbcl*.whl rbcl-wheelhouse/${{ env.WHEELNAME }}.whl
71-
- uses: actions/upload-artifact@v1
68+
- uses: actions/upload-artifact@v3
7269
with:
7370
name: ${{ env.WHEELNAME }}
7471
path: rbcl-wheelhouse/
@@ -77,24 +74,24 @@ jobs:
7774
strategy:
7875
matrix:
7976
python:
80-
- {version: '3.7', version-abi: 'cp37', version-url: '3.7.9'}
81-
- {version: '3.8', version-abi: 'cp38', version-url: '3.8.9'}
82-
- {version: '3.9', version-abi: 'cp39', version-url: '3.9.9'}
83-
name: Python ${{ matrix.python.version }} with ABI ${{ matrix.python.version-abi }} for macOS 10.9
77+
- {version: '3.7', abi: 'cp37', url: '3.7.9'}
78+
- {version: '3.8', abi: 'cp38', url: '3.8.9'}
79+
- {version: '3.9', abi: 'cp39', url: '3.9.9'}
80+
name: Python ${{ matrix.python.version }} with ABI ${{ matrix.python.abi }} for macOS 10.9
8481
env:
85-
WHEELNAME: rbcl-${{ github.ref_name }}-${{ matrix.python.version-abi }}-abi3-macosx_10_9_x86_64
82+
WHEELNAME: rbcl-${{ github.ref_name }}-${{ matrix.python.abi }}-abi3-macosx_10_9_x86_64
8683
steps:
87-
- uses: actions/checkout@v3
88-
- name: Download libsodium source tree archive.
89-
run: |
90-
wget https://download.libsodium.org/libsodium/releases/libsodium-1.0.18.tar.gz
91-
mv libsodium-1.0.18.tar.gz src/rbcl/libsodium.tar.gz
84+
- uses: actions/checkout@v4
9285
- name: Install Python.
9386
run: |
94-
curl "https://www.python.org/ftp/python/${{ matrix.python.version-url }}/python-${{ matrix.python.version-url }}-macosx10.9.pkg" -o python.pkg
87+
curl "https://www.python.org/ftp/python/${{ matrix.python.url }}/python-${{ matrix.python.url }}-macosx10.9.pkg" -o python.pkg
9588
sudo installer -pkg python.pkg -target /
9689
/Library/Frameworks/Python.framework/Versions/${{ matrix.python.version }}/bin/python3 -m pip install -U virtualenv
9790
/Library/Frameworks/Python.framework/Versions/${{ matrix.python.version }}/bin/python3 -m virtualenv venv
91+
- name: Download libsodium source tree archive.
92+
run: |
93+
wget https://download.libsodium.org/libsodium/releases/libsodium-1.0.18.tar.gz
94+
mv libsodium-1.0.18.tar.gz src/rbcl/libsodium.tar.gz
9895
- name: Install Python dependencies for build process.
9996
run: |
10097
venv/bin/pip install -U pip .[build]
@@ -125,7 +122,7 @@ jobs:
125122
run: |
126123
mkdir rbcl-wheelhouse
127124
mv wheelhouse/rbcl*.whl rbcl-wheelhouse/${{ env.WHEELNAME }}.whl
128-
- uses: actions/upload-artifact@v1
125+
- uses: actions/upload-artifact@v3
129126
with:
130127
name: ${{ env.WHEELNAME }}
131128
path: rbcl-wheelhouse/
@@ -134,24 +131,24 @@ jobs:
134131
strategy:
135132
matrix:
136133
python:
137-
- {version: '3.9', version-abi: 'cp39', version-url: '3.9.9'}
138-
- {version: '3.10', version-abi: 'cp310', version-url: '3.10.6'}
139-
- {version: '3.11', version-abi: 'cp311', version-url: '3.11.3'}
140-
name: Python ${{ matrix.python.version }} with ABI ${{ matrix.python.version-abi }} for macOS 11 ARM
134+
- {version: '3.9', abi: 'cp39', url: '3.9.9'}
135+
- {version: '3.10', abi: 'cp310', url: '3.10.6'}
136+
- {version: '3.11', abi: 'cp311', url: '3.11.3'}
137+
name: Python ${{ matrix.python.version }} with ABI ${{ matrix.python.abi }} for macOS 11 ARM
141138
env:
142-
WHEELNAME: rbcl-${{ github.ref_name }}-${{ matrix.python.version-abi }}-abi3-macosx_10_10_universal2
139+
WHEELNAME: rbcl-${{ github.ref_name }}-${{ matrix.python.abi }}-abi3-macosx_10_10_universal2
143140
steps:
144-
- uses: actions/checkout@v3
145-
- name: Download libsodium source tree archive.
146-
run: |
147-
wget https://download.libsodium.org/libsodium/releases/libsodium-1.0.18.tar.gz
148-
mv libsodium-1.0.18.tar.gz src/rbcl/libsodium.tar.gz
141+
- uses: actions/checkout@v4
149142
- name: Install Python.
150143
run: |
151-
curl "https://www.python.org/ftp/python/${{ matrix.python.version-url }}/python-${{ matrix.python.version-url }}-macos11.pkg" -o python.pkg
144+
curl "https://www.python.org/ftp/python/${{ matrix.python.url }}/python-${{ matrix.python.url }}-macos11.pkg" -o python.pkg
152145
sudo installer -pkg python.pkg -target /
153146
/Library/Frameworks/Python.framework/Versions/${{ matrix.python.version }}/bin/python3 -m pip install -U virtualenv
154147
/Library/Frameworks/Python.framework/Versions/${{ matrix.python.version }}/bin/python3 -m virtualenv venv
148+
- name: Download libsodium source tree archive.
149+
run: |
150+
wget https://download.libsodium.org/libsodium/releases/libsodium-1.0.18.tar.gz
151+
mv libsodium-1.0.18.tar.gz src/rbcl/libsodium.tar.gz
155152
- name: Install Python dependencies for build process.
156153
run: |
157154
venv/bin/pip install -U pip .[build]
@@ -182,7 +179,7 @@ jobs:
182179
run: |
183180
mkdir rbcl-wheelhouse
184181
mv wheelhouse/rbcl*.whl rbcl-wheelhouse/${{ env.WHEELNAME }}.whl
185-
- uses: actions/upload-artifact@v1
182+
- uses: actions/upload-artifact@v3
186183
with:
187184
name: ${{ env.WHEELNAME }}
188185
path: rbcl-wheelhouse/
@@ -194,31 +191,31 @@ jobs:
194191
- {version: 'win32', arch: 'x86', arch-sodium: 'Win32', arch-vs: 'x86'}
195192
- {version: 'win_amd64', arch: 'x64', arch-sodium: 'x64', arch-vs: 'amd64'}
196193
python:
197-
- {version: '3.7', version-abi: 'cp37'}
198-
- {version: '3.8', version-abi: 'cp38'}
199-
- {version: '3.9', version-abi: 'cp39'}
200-
- {version: '3.10', version-abi: 'cp310'}
201-
- {version: '3.11', version-abi: 'cp311'}
202-
name: Python ${{ matrix.python.version }} with ABI ${{ matrix.python.version-abi }} for Windows ${{ matrix.windows.arch }}
194+
- {version: '3.7', abi: 'cp37'}
195+
- {version: '3.8', abi: 'cp38'}
196+
- {version: '3.9', abi: 'cp39'}
197+
- {version: '3.10', abi: 'cp310'}
198+
- {version: '3.11', abi: 'cp311'}
199+
name: Python ${{ matrix.python.version }} with ABI ${{ matrix.python.abi }} for Windows ${{ matrix.windows.arch }}
203200
env:
204-
WHEELNAME: rbcl-${{ github.ref_name }}-${{ matrix.python.version-abi }}-abi3-${{ matrix.windows.version }}
201+
WHEELNAME: rbcl-${{ github.ref_name }}-${{ matrix.python.abi }}-abi3-${{ matrix.windows.version }}
205202
INCLUDE: C:\libsodium\include
206203
LIB: C:\libsodium\${{ matrix.windows.arch-sodium }}\Release\v142\dynamic\
207204
steps:
208-
- uses: actions/checkout@v3
209-
- name: Download and extract libsodium dynamic library file.
210-
run: |
211-
wget -O C:\libsodium-1.0.18-msvc.zip https://download.libsodium.org/libsodium/releases/libsodium-1.0.18-msvc.zip
212-
Expand-Archive C:\libsodium-1.0.18-msvc.zip -DestinationPath C:\
213-
shell: powershell
205+
- uses: actions/checkout@v4
214206
- name: Install Python.
215207
uses: actions/setup-python@v4
216208
with:
217209
python-version: ${{ matrix.python.version }}
218210
architecture: ${{ matrix.windows.arch }}
211+
- name: Download and extract libsodium dynamic library file.
212+
run: |
213+
wget -O C:\libsodium-1.0.18-msvc.zip https://download.libsodium.org/libsodium/releases/libsodium-1.0.18-msvc.zip
214+
Expand-Archive C:\libsodium-1.0.18-msvc.zip -DestinationPath C:\
215+
shell: powershell
219216
- name: Install Python dependencies for build process.
220217
run: |
221-
python -m pip install -U pip .[build]
218+
pip install -U pip .[build]
222219
shell: bash
223220
- name: Build wheel file.
224221
run: |
@@ -234,14 +231,14 @@ jobs:
234231
shell: bash
235232
- name: Lint and test module (and compiled libsodium shared library file).
236233
run: |
237-
python -m pip install -U pip .[lint,test]
234+
pip install -U pip .[lint,test]
238235
python -m pylint rbcl src/rbcl/_sodium.tmpl src/rbcl/_sodium_build.py --disable=duplicate-code # Check against linting rules.
239236
python src/rbcl/rbcl.py -v # Run doctests.
240237
python -m pytest # Run tests.
241238
shell: bash
242239
- name: Test auto-generation of documentation.
243240
run: |
244-
python -m pip install -U .[docs]
241+
pip install -U .[docs]
245242
cd docs
246243
sphinx-apidoc -f -E --templatedir=_templates -o _source .. ../src/rbcl/_sodium_build.py
247244
make html
@@ -252,7 +249,7 @@ jobs:
252249
mkdir rbcl-wheelhouse
253250
move wheelhouse\rbcl*.whl rbcl-wheelhouse\${{ env.WHEELNAME }}.whl
254251
shell: cmd
255-
- uses: actions/upload-artifact@v1
252+
- uses: actions/upload-artifact@v3
256253
with:
257254
name: ${{ env.WHEELNAME }}
258255
path: rbcl-wheelhouse\

0 commit comments

Comments
 (0)