Repository navigation
153 lines (139 loc) · 5.91 KB
/
Copy pathcontent-smoke.yml
File metadata and controls
153 lines (139 loc) · 5.91 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
name: Content Smoke
# Runs the shipped snippets and the `<!-- smoke: run -->` blocks in
# skills/*/SKILL.md in place, on 5.2 LTS and 4.5 LTS (#447). A positive
# `paths` filter, not blender-smoke.yml's paths-ignore: that one ignores
# "**.md", so a SKILL.md-only change would never reach Blender.
# release-gate.sh waits for this run on a direct push that touches these paths.
on:
workflow_dispatch:
schedule:
- cron: "30 7 * * 1" # weekly, after blender-smoke: catches upstream API drift
push:
branches: [main]
paths:
- "skills/**"
- "snippets/**"
- "tests/smoke/run_content.py"
- "tests/smoke/snippet_checks.py"
- ".github/workflows/content-smoke.yml"
pull_request:
branches: [main]
paths:
- "skills/**"
- "snippets/**"
- "tests/smoke/run_content.py"
- "tests/smoke/snippet_checks.py"
- ".github/workflows/content-smoke.yml"
permissions:
contents: read
concurrency:
group: content-smoke-${{ github.event.pull_request.number || (github.event_name == 'push' && github.sha) || github.ref }}
cancel-in-progress: true
jobs:
content:
name: Blender ${{ matrix.series }} content smoke
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
series: ["5.2", "4.5"]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Install Blender runtime libraries
run: |
set -euo pipefail
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
xvfb libgl1 libegl1 libxrender1 libxxf86vm1 libxfixes3 libxi6 \
libxkbcommon0 libsm6 libice6
- name: Resolve Blender ${{ matrix.series }}
id: resolve
run: |
set -euo pipefail
series="${{ matrix.series }}"
base="https://download.blender.org/release/Blender${series}/"
file=$(curl -fsSL "$base" \
| grep -oE "blender-${series}\.[0-9]+-linux-x64\.tar\.xz" \
| sort -V | uniq | tail -1)
if [ -z "$file" ]; then
echo "::error::Could not resolve a linux-x64 build for Blender ${series} at $base"
exit 1
fi
version="${file#blender-}"
version="${version%-linux-x64.tar.xz}"
echo "base=$base" >> "$GITHUB_OUTPUT"
echo "file=$file" >> "$GITHUB_OUTPUT"
echo "version=$version" >> "$GITHUB_OUTPUT"
echo "Resolved Blender $version"
- name: Restore Blender ${{ steps.resolve.outputs.version }} from cache
id: bl-cache
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ${{ runner.temp }}/bl
key: blender-${{ steps.resolve.outputs.version }}-linux-x64
- name: Download Blender and verify its published sha256
if: steps.bl-cache.outputs.cache-hit != 'true'
run: |
set -euo pipefail
base="${{ steps.resolve.outputs.base }}"
file="${{ steps.resolve.outputs.file }}"
version="${{ steps.resolve.outputs.version }}"
mkdir -p "$RUNNER_TEMP/bl"
curl -fSL --retry 3 -o "$RUNNER_TEMP/bl.tar.xz" "${base}${file}"
curl -fsSL --retry 3 -o "$RUNNER_TEMP/bl.sha256" "${base}blender-${version}.sha256"
expected=$(grep -E " ${file}$" "$RUNNER_TEMP/bl.sha256" | awk '{print $1}')
if [ -z "$expected" ]; then
echo "::error::no published sha256 for ${file}"
exit 1
fi
echo "${expected} $RUNNER_TEMP/bl.tar.xz" | sha256sum -c - \
|| { echo "::error::sha256 mismatch for ${file}; refusing to extract"; exit 1; }
tar -xf "$RUNNER_TEMP/bl.tar.xz" -C "$RUNNER_TEMP/bl"
- name: Locate Blender binary
run: |
set -euo pipefail
bl=$(find "$RUNNER_TEMP/bl" -maxdepth 2 -type f -name blender | head -1)
if [ -z "$bl" ]; then
echo "::error::blender binary not found"
exit 1
fi
echo "BLENDER=$bl" >> "$GITHUB_ENV"
"$bl" --version | head -1 | grep -q "Blender ${{ matrix.series }}\." \
|| { echo "::error::version does not match series ${{ matrix.series }}"; exit 1; }
- name: Run every snippet (and its falsifier) and every tagged SKILL.md block
run: |
set -euo pipefail
xvfb-run -a "$BLENDER" --background --factory-startup --python-exit-code 1 \
--python tests/smoke/run_content.py
report-scheduled-failure:
# A red weekly cron otherwise goes unnoticed (#482, #538): open an issue,
# or comment on the one already open.
name: Report a failed weekly run
needs: [content]
if: >-
always() && github.event_name == 'schedule' &&
(contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled'))
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
issues: write
steps:
- name: Open or update the tracking issue
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
run: |
set -euo pipefail
title="Weekly content smoke run failed"
body="Scheduled run: $RUN_URL
A snippet, its falsifier, or a tagged SKILL.md block failed on a floating Blender point release: likely upstream API drift. Reproduce with tests/smoke/run_content.py --only NAME.
Opened by content-smoke.yml (report-scheduled-failure). Close it once a weekly run is green."
num=$(gh issue list --state open --search "\"$title\" in:title" --json number --jq '.[0].number // empty')
if [ -n "$num" ]; then
gh issue comment "$num" --body "$body"
echo "commented on #$num"
else
gh issue create --title "$title" --body "$body" --label "bug,ci,priority: high"
fi