Repository navigation
99 lines (90 loc) · 3.53 KB
/
Copy pathtemplate_example_test.yml
File metadata and controls
99 lines (90 loc) · 3.53 KB
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
name: example tests template
on:
workflow_call:
inputs:
os:
required: true
type: string
description: 'Runner OS (ubuntu-latest, macos-latest, or windows-latest)'
build-mode:
required: false
type: string
default: debug
description: 'Native sanitizer preset (debug or Linux-only debug-thin)'
example-group:
required: false
type: string
default: CompileTests
description: 'Example group to compile (CompileTests for the live gate)'
reserved-runs-on:
required: false
type: string
default: ""
description: 'JSON runner selection from the caller for this build only.'
permissions:
contents: read # Required to checkout code
actions: read # Required for artifact operations
pull-requests: read # If needed to read PR info
defaults:
run:
shell: bash
jobs:
build:
runs-on: ${{ inputs.reserved-runs-on != '' && fromJSON(inputs.reserved-runs-on) || inputs.os }}
env:
FASTLED_NATIVE_CLANG: ${{ startsWith(inputs.os, 'ubuntu') && 'soldr' || '' }}
# Fail fast instead of waiting for the 6h default runner timeout.
# Successful runs complete in ~8-20 minutes; anything past 45m is hung.
# Observed Windows runners hanging in the Install step for 3+ hours
# before losing communication with the server (runs/24593311481).
timeout-minutes: 45
steps:
- name: Checkout
uses: actions/checkout@v7
with:
persist-credentials: false
ref: ${{ github.event.pull_request.head.sha || github.sha }}
- name: Install Python
uses: actions/setup-python@v7
with:
python-version: '3.10'
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
save-cache: ${{ github.ref == 'refs/heads/master' && (github.event_name == 'push' || github.event_name == 'schedule') }}
enable-cache: true
cache-dependency-glob: "**/pyproject.toml"
version: "0.8.0" # 0.8.8 has problems with deployment on linux.
- name: Install libunwind-dev (Linux only)
if: runner.os == 'Linux'
# Strip the optional Microsoft apt source that periodically returns 403
# on hosted Ubuntu images, and skip apt if libunwind-dev is preinstalled.
run: |
if ! dpkg -s libunwind-dev >/dev/null 2>&1; then
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list \
/etc/apt/sources.list.d/microsoft-prod.sources
sudo apt-get update
sudo apt-get install -y libunwind-dev
fi
- name: Sync Python environment
run: uv sync
shell: bash
- name: Compile ${{ inputs.example-group }}
env:
FASTLED_BUILD_MODE: ${{ inputs.build-mode }}
FASTLED_EXAMPLE_GROUP: ${{ inputs.example-group }}
run: |
export PYTHONUNBUFFERED=1
export PYTHONIOENCODING=utf-8
if [[ "$RUNNER_OS" == Linux && "$FASTLED_EXAMPLE_GROUP" == CompileTests ]]; then
export FASTLED_EXAMPLE_JOBS=2
fi
./test --clang --examples --example-group "$FASTLED_EXAMPLE_GROUP" --verbose --build-mode "$FASTLED_BUILD_MODE"
if [[ "$RUNNER_OS" == Linux ]]; then
build_suffix=""
if [[ "$FASTLED_EXAMPLE_GROUP" == CompileTests ]]; then
build_suffix="-compile-tests"
fi
du -sb ".build/meson-${FASTLED_BUILD_MODE}${build_suffix}" | awk '{print "Build bytes: " $1}'
fi
shell: bash