Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
93 changes: 93 additions & 0 deletions .github/workflows/_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: Build

on:
workflow_call:
inputs:
runs-on:
required: true
type: string
maturin-target:
required: false
type: string
default: ""

jobs:
build:
runs-on: ${{ inputs.runs-on }}
timeout-minutes: 30
defaults:
run:
shell: bash
env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: sccache
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.11"

- uses: astral-sh/setup-uv@v5
with:
enable-cache: true

- uses: mozilla-actions/sccache-action@v0.0.9

- name: Set Rust toolchain
run: |
CHANNEL=$(grep 'channel' rust-toolchain.toml | head -1 | sed 's/.*= *"\(.*\)"/\1/')
echo "RUSTUP_TOOLCHAIN=$CHANNEL" >> "$GITHUB_ENV"

- uses: Swatinem/rust-cache@v2
with:
shared-key: fastled-${{ inputs.runs-on }}
cache-targets: false

- name: Install system dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update -qq
sudo apt-get install -y -qq libgtk-3-dev libwebkit2gtk-4.1-dev libayatana-appindicator3-dev librsvg2-dev

- name: Install
run: ./install

- name: Add cross-compile target
if: inputs.maturin-target != ''
run: rustup target add "${{ inputs.maturin-target }}"

- name: Build wheel
run: |
if [ -n "${{ inputs.maturin-target }}" ]; then
# Generate import lib stub for cross-compilation.
# PyO3 abi3-py310 expects python310.lib but generate-import-lib
# creates python3.lib; copy to satisfy the linker.
BUILD_DIR="target/${{ inputs.maturin-target }}/release/build"
uv run maturin build --release --target "${{ inputs.maturin-target }}" || {
echo "First build failed — patching import lib name..."
for d in "$BUILD_DIR"/pyo3-ffi-*/out/lib; do
if [ -f "$d/python3.lib" ] && [ ! -f "$d/python310.lib" ]; then
cp "$d/python3.lib" "$d/python310.lib"
echo "Copied python3.lib -> python310.lib in $d"
fi
done
uv run maturin build --release --target "${{ inputs.maturin-target }}"
}
else
uv run maturin build --release
fi

- name: Upload wheel
uses: actions/upload-artifact@v4
with:
name: wheel-${{ inputs.runs-on }}-${{ inputs.maturin-target || 'native' }}
path: target/wheels/*.whl

- name: Upload failure logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: failure-logs-build-${{ inputs.runs-on }}
path: logs/*
if-no-files-found: warn
65 changes: 65 additions & 0 deletions .github/workflows/_integration-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Integration Test

on:
workflow_call:
inputs:
runs-on:
required: true
type: string

jobs:
integration-test:
runs-on: ${{ inputs.runs-on }}
timeout-minutes: 30
defaults:
run:
shell: bash
env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: sccache
PYTHONIOENCODING: utf-8
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.11"

- uses: astral-sh/setup-uv@v5
with:
enable-cache: true

- uses: mozilla-actions/sccache-action@v0.0.9

- name: Set Rust toolchain
run: |
CHANNEL=$(grep 'channel' rust-toolchain.toml | head -1 | sed 's/.*= *"\(.*\)"/\1/')
echo "RUSTUP_TOOLCHAIN=$CHANNEL" >> "$GITHUB_ENV"

- uses: Swatinem/rust-cache@v2
with:
shared-key: fastled-${{ inputs.runs-on }}
cache-targets: false

- name: Install system dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update -qq
sudo apt-get install -y -qq libgtk-3-dev libwebkit2gtk-4.1-dev libayatana-appindicator3-dev librsvg2-dev

- name: Install
run: ./install

- name: Install Playwright browsers
run: uv run playwright install chromium

- name: Integration Tests
run: uv run pytest -x -v -s tests/integration

- name: Upload failure logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: failure-logs-integration-test-${{ inputs.runs-on }}
path: logs/*
if-no-files-found: warn
61 changes: 61 additions & 0 deletions .github/workflows/_lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Lint

on:
workflow_call:
inputs:
runs-on:
required: true
type: string

jobs:
lint:
runs-on: ${{ inputs.runs-on }}
timeout-minutes: 30
defaults:
run:
shell: bash
env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: sccache
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.11"

- uses: astral-sh/setup-uv@v5
with:
enable-cache: true

- uses: mozilla-actions/sccache-action@v0.0.9

- name: Set Rust toolchain
run: |
CHANNEL=$(grep 'channel' rust-toolchain.toml | head -1 | sed 's/.*= *"\(.*\)"/\1/')
echo "RUSTUP_TOOLCHAIN=$CHANNEL" >> "$GITHUB_ENV"

- uses: Swatinem/rust-cache@v2
with:
shared-key: fastled-${{ inputs.runs-on }}
cache-targets: false

- name: Install system dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update -qq
sudo apt-get install -y -qq libgtk-3-dev libwebkit2gtk-4.1-dev libayatana-appindicator3-dev librsvg2-dev

- name: Install
run: ./install

- name: Lint
run: ./lint

- name: Upload failure logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: failure-logs-lint-${{ inputs.runs-on }}
path: logs/*
if-no-files-found: warn
62 changes: 62 additions & 0 deletions .github/workflows/_unit-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Unit Test

on:
workflow_call:
inputs:
runs-on:
required: true
type: string

jobs:
unit-test:
runs-on: ${{ inputs.runs-on }}
timeout-minutes: 30
defaults:
run:
shell: bash
env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: sccache
PYTHONIOENCODING: utf-8
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.11"

- uses: astral-sh/setup-uv@v5
with:
enable-cache: true

- uses: mozilla-actions/sccache-action@v0.0.9

- name: Set Rust toolchain
run: |
CHANNEL=$(grep 'channel' rust-toolchain.toml | head -1 | sed 's/.*= *"\(.*\)"/\1/')
echo "RUSTUP_TOOLCHAIN=$CHANNEL" >> "$GITHUB_ENV"

- uses: Swatinem/rust-cache@v2
with:
shared-key: fastled-${{ inputs.runs-on }}
cache-targets: false

- name: Install system dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update -qq
sudo apt-get install -y -qq libgtk-3-dev libwebkit2gtk-4.1-dev libayatana-appindicator3-dev librsvg2-dev

- name: Install
run: ./install

- name: Unit Tests
run: ./test

- name: Upload failure logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: failure-logs-unit-test-${{ inputs.runs-on }}
path: logs/*
if-no-files-found: warn
23 changes: 0 additions & 23 deletions .github/workflows/lint.yml

This file was deleted.

13 changes: 13 additions & 0 deletions .github/workflows/linux-arm-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Linux ARM Build

on:
push:
branches: [main]
pull_request:
workflow_dispatch:

jobs:
call:
uses: ./.github/workflows/_build.yml
with:
runs-on: ubuntu-24.04-arm
13 changes: 13 additions & 0 deletions .github/workflows/linux-arm-integration-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Linux ARM Integration Test

on:
push:
branches: [main]
pull_request:
workflow_dispatch:

jobs:
call:
uses: ./.github/workflows/_integration-test.yml
with:
runs-on: ubuntu-24.04-arm
13 changes: 13 additions & 0 deletions .github/workflows/linux-arm-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Linux ARM Lint

on:
push:
branches: [main]
pull_request:
workflow_dispatch:

jobs:
call:
uses: ./.github/workflows/_lint.yml
with:
runs-on: ubuntu-24.04-arm
13 changes: 13 additions & 0 deletions .github/workflows/linux-arm-unit-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Linux ARM Unit Test

on:
push:
branches: [main]
pull_request:
workflow_dispatch:

jobs:
call:
uses: ./.github/workflows/_unit-test.yml
with:
runs-on: ubuntu-24.04-arm
13 changes: 13 additions & 0 deletions .github/workflows/linux-x86-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Linux x86 Build

on:
push:
branches: [main]
pull_request:
workflow_dispatch:

jobs:
call:
uses: ./.github/workflows/_build.yml
with:
runs-on: ubuntu-24.04
13 changes: 13 additions & 0 deletions .github/workflows/linux-x86-integration-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Linux x86 Integration Test

on:
push:
branches: [main]
pull_request:
workflow_dispatch:

jobs:
call:
uses: ./.github/workflows/_integration-test.yml
with:
runs-on: ubuntu-24.04
Loading
Loading