Skip to content
Open
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
5635c1b
feat: Setup local testing with pytest
baalimago Sep 16, 2025
26265fb
feat: Added support for running tests in wasmer runtime
baalimago Sep 17, 2025
a943e0c
docs: Changed back formatting to not joink git blame
baalimago Sep 17, 2025
f22c676
docs: Added final step to run tests in wasmer
baalimago Sep 17, 2025
948d8cd
feat(debug): Added tests to pipeline as final step
baalimago Sep 17, 2025
fda3a22
revertme: Removed path requirement
baalimago Sep 17, 2025
e29005d
feat: Separated the workflow for reusability, fixed runner issue
baalimago Sep 17, 2025
79b03a3
fix: Correct path to workflow
baalimago Sep 17, 2025
9369961
tweak: Removed pyenv, shouldnt be needed
baalimago Sep 17, 2025
a13a800
fix: Install zbar since tests didnt want to pass without it
baalimago Sep 17, 2025
ecba365
feat: Ghetto-pytest refactor (aka compilation-station)
baalimago Sep 17, 2025
96e26b6
tweaks: Inject psql server details as env vars, spelling
baalimago Sep 17, 2025
2ea54f2
tweaks: Removed pytest from dependencies
baalimago Sep 18, 2025
bcdf4a3
feat: Converted project to be fastapi
baalimago Sep 18, 2025
e0107f9
refactor: It now deploys and runs on edge
baalimago Sep 18, 2025
24467a3
feat: Added <api>/check/<test> and added run-all-tests-via-api.py
baalimago Sep 18, 2025
3d89331
feat: Allow resolving IP to specific server on run-all-tests
baalimago Sep 18, 2025
4ee7f70
cleanup: PR comments
baalimago Sep 18, 2025
68ab11b
cleanup: Reset README oopsie overwrite
baalimago Sep 18, 2025
424cfb6
Apply suggestion from @zebreus
baalimago Sep 18, 2025
62348cd
cleanup: Moved new testing system into directory testing
baalimago Sep 18, 2025
250060c
cleanup: Removed try-catch on pysql and mysql tests to fish for linke…
baalimago Sep 18, 2025
a83b06f
tweaks: Test pipeline should in theory now work
baalimago Sep 18, 2025
7a4e785
tweaks: ... theory was incorrect, now it should work
baalimago Sep 18, 2025
d805739
fix: Paths should now be OK
baalimago Sep 18, 2025
e4dab79
fix: Path to wasmer
baalimago Sep 18, 2025
953ffe4
tweak: Fix path for running python tests natively
baalimago Sep 18, 2025
1ed415e
feat: Re-enable contine-on-error for native tests
baalimago Sep 18, 2025
fbcfe19
revert: Pipeline now runs only as last step of normal release
baalimago Sep 18, 2025
b3ea1a9
tweak: Reset formatting to not joink git blame on merge commit
baalimago Sep 18, 2025
b85f988
tweak: Updated "broken filter" in run-tests.sh
baalimago Sep 18, 2025
2bcfe10
feat: Added env var ALLOW_BROKEN to list broken tests
baalimago Sep 19, 2025
f889f33
tweaks: Final things while push to prod + compile, tweaked readme
baalimago Sep 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
133 changes: 74 additions & 59 deletions .github/workflows/generate-index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,74 +3,89 @@ name: Build and Deploy Python Index to GitHub Pages
on:
push:
branches:
- main # Re-generate index on every change to the default branch
paths:
- artifacts/*.whl
- generate-index.py
- python-wasix-binaries
- main # Re-generate index on every change to the default branch
- qa-209-convert-build-scripts-into-a-python-test-project
# paths:
# - artifacts/*.whl
# - generate-index.py
# - python-wasix-binaries
workflow_dispatch:

# Minimal permissions required by the official Pages deployment action
# NOTE: these are REPLACED, not merged, with job-level permissions
permissions:
contents: read # to checkout the repository
pages: write # to deploy to Pages
id-token: write # to verify deployment origin
contents: read # to checkout the repository
pages: write # to deploy to Pages
id-token: write # to verify deployment origin

concurrency:
group: "deploy-pages"
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v4
with:
lfs: true
submodules: false
sparse-checkout: |
# Only checkout the files needed to generate the index
artifacts
generate-index.py
python-wasix-binaries
- name: Checkout python-wasix-binaries
run: |
git submodule update --init python-wasix-binaries
# Install a fast Python environment + the `uv` CLI (with cache)
- name: Setup uv & Python
uses: astral-sh/setup-uv@v6
with:
# Install the runner's system Python (faster than compiling)
python-version: "3.12"
enable-cache: true
# Reuse cache when lockfile or project metadata didn’t change
cache-dependency-glob: |
generate-index.py
- name: Generate static package index
run: |
./generate-index.py
# build:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout source
# uses: actions/checkout@v4
# with:
# lfs: true
# submodules: false
# sparse-checkout: |
# # Only checkout the files needed to generate the index
# artifacts
# generate-index.py
# python-wasix-binaries
# - name: Checkout python-wasix-binaries
# run: |
# git submodule update --init python-wasix-binaries
# # Install a fast Python environment + the `uv` CLI (with cache)
# - name: Setup uv & Python
# uses: astral-sh/setup-uv@v6
# with:
# # Install the runner's system Python (faster than compiling)
# python-version: "3.12"
# enable-cache: true
# # Reuse cache when lockfile or project metadata didn’t change
# cache-dependency-glob: |
# generate-index.py
# - name: Generate static package index
# run: |
# ./generate-index.py
#
# # Upload the "dist" folder produced by the script so it can be
# # deployed by the next job.
# - name: Upload Pages artifact
# uses: actions/upload-pages-artifact@v3
# with:
# path: dist
#
# deploy:
# needs: build
# runs-on: ubuntu-latest
# environment:
# name: github-pages # default Pages environment
# url: ${{ steps.deploy.outputs.page_url }}
# # Job-level permissions must explicitly include the same set
# permissions:
# contents: read
# pages: write
# id-token: write
# steps:
# - name: Deploy to GitHub Pages
# id: deploy
# uses: actions/deploy-pages@v4

# Upload the "dist" folder produced by the script so it can be
# deployed by the next job.
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: dist

deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages # default Pages environment
url: ${{ steps.deploy.outputs.page_url }}
# Job-level permissions must explicitly include the same set
permissions:
contents: read
pages: write
id-token: write
steps:
- name: Deploy to GitHub Pages
id: deploy
uses: actions/deploy-pages@v4
test:
strategy:
matrix:
python-version: ["3.13"]
wasmer-version: ["v6.1.0-rc.3"]
uses: ./.github/workflows/test-python-index.yaml
with:
python-version: ${{ matrix.python-version }}
wasmer-version: ${{ matrix.wasmer-version }}
# Test primary python index only for now. This
# setup allows for hosting a separate "testing" python
# index down the line (or simply a local one)
python-index: https://pythonindex.wasix.org
62 changes: 62 additions & 0 deletions .github/workflows/test-python-index.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Test Workflow

on:
workflow_call:
inputs:
python-version:
required: true
type: string
wasmer-version:
required: true
type: string
python-index:
required: true
type: string
ubuntu-runner:
required: false
type: string
default: "ubuntu-24.04"

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Set up Python ${{ inputs.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}
- name: Setup environment
run: |
sudo apt-get install libzbar0
pip install .
pip install pytest
# Validate that the python tests themselves are valid
- name: Run tests
run: pytest

# Secondly, validate that the tests pass within wasmer as well
- name: Install uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Install wasmer
run: curl https://get.wasmer.io -sSfL | sh -s ${{ inputs.wasmer-version }}
- name: Setup project for wasmer
run: |
uv pip compile pyproject.toml \
--python-version=${{ inputs.python-version }} \
--universal \
--extra-index-url ${{ inputs.python-index }}/simple \
--index-url=https://pypi.org/simple \
--emit-index-url \
--only-binary :all: \
-o wasmer-requirements.txt

uvx pip install -r wasmer-requirements.txt \
--python-version=${{ inputs.python-version }} \
--target wasix-site-packages \
--platform wasix_wasm32 \
--only-binary=:all: \
--compile
# Ensure tests pass on wasmer
- name: Run tests (wasmer)
run: wasmer run .
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ __pycache__
/pkgs/*.build
/pkgs/*.prepared
/pkgs/*.sysroot
wasix-site-packages
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.13
Loading
Loading