Skip to content

Commit 893f06b

Browse files
committed
Implements vendoring CI.
1 parent 4cecd49 commit 893f06b

4 files changed

Lines changed: 69 additions & 0 deletions

File tree

.github/workflows/vendoring.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Python Workers Vendoring CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
vendoring:
13+
strategy:
14+
matrix:
15+
os: [ubuntu-latest, macos-latest, windows-latest]
16+
runs-on: ${{ matrix.os }}
17+
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
22+
- name: Set up Python
23+
uses: actions/setup-python@v4
24+
with:
25+
python-version: '3.12'
26+
27+
- name: Run vendoring script (Linux/macOS)
28+
if: runner.os != 'Windows'
29+
run: ./.github/workflows/vendoring/unix.sh
30+
shell: bash
31+
32+
- name: Run vendoring script (Windows)
33+
if: runner.os == 'Windows'
34+
continue-on-error: true
35+
run: .github\workflows\vendoring\windows.bat
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
3+
cd 06-vendoring
4+
python3.12 -m venv .venv
5+
source .venv/bin/activate
6+
.venv/bin/pip install pyodide-build
7+
.venv/bin/pyodide venv .venv-pyodide
8+
.venv-pyodide/bin/pip install -t src/vendor -r vendor.txt
9+
10+
if [ -z "$(ls -A src/vendor)" ]; then
11+
echo "Vendoring failed: No files in src/vendor"
12+
exit 1
13+
fi
14+
15+
echo "Vendoring succeeded, listing files in src/vendor..."
16+
command -v tree &>/dev/null && tree src/vendor || find src/vendor
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
@echo off
2+
3+
cd 06-vendoring
4+
python -m venv .venv
5+
call .venv\Scripts\activate
6+
.venv\Scripts\pip install pyodide-build
7+
.venv\Scripts\pyodide venv .venv-pyodide
8+
.venv-pyodide\Scripts\pip install -t src/vendor -r vendor.txt
9+
10+
if not exist src\vendor\* (
11+
echo Vendoring failed: No files in src/vendor
12+
exit /b 1
13+
)
14+
15+
echo Vendoring succeeded, listing files in src/vendor...
16+
tree /f /a src\vendor

06-vendoring/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ Vendored packages are added to your source files and need to be installed in a s
1212

1313
### Vendoring Packages
1414

15+
[//]: # (NOTE: when updating the instructions below, be sure to also update the vendoring.yml CI workflow)
16+
1517
First, install Python3.12 and pip for Python 3.12.
1618

1719
*Currently, other versions of Python will not work - use 3.12!*

0 commit comments

Comments
 (0)