|
| 1 | +name: Content Smoke |
| 2 | + |
| 3 | +# Runs the shipped snippets and the `<!-- smoke: run -->` blocks in |
| 4 | +# skills/*/SKILL.md in place, on 5.2 LTS and 4.5 LTS (#447). A positive |
| 5 | +# `paths` filter, not blender-smoke.yml's paths-ignore: that one ignores |
| 6 | +# "**.md", so a SKILL.md-only change would never reach Blender. |
| 7 | +# release-gate.sh waits for this run on a direct push that touches these paths. |
| 8 | + |
| 9 | +on: |
| 10 | + workflow_dispatch: |
| 11 | + schedule: |
| 12 | + - cron: "30 7 * * 1" # weekly, after blender-smoke: catches upstream API drift |
| 13 | + push: |
| 14 | + branches: [main] |
| 15 | + paths: |
| 16 | + - "skills/**" |
| 17 | + - "snippets/**" |
| 18 | + - "tests/smoke/run_content.py" |
| 19 | + - "tests/smoke/snippet_checks.py" |
| 20 | + - ".github/workflows/content-smoke.yml" |
| 21 | + pull_request: |
| 22 | + branches: [main] |
| 23 | + paths: |
| 24 | + - "skills/**" |
| 25 | + - "snippets/**" |
| 26 | + - "tests/smoke/run_content.py" |
| 27 | + - "tests/smoke/snippet_checks.py" |
| 28 | + - ".github/workflows/content-smoke.yml" |
| 29 | + |
| 30 | +permissions: |
| 31 | + contents: read |
| 32 | + |
| 33 | +concurrency: |
| 34 | + group: content-smoke-${{ github.event.pull_request.number || (github.event_name == 'push' && github.sha) || github.ref }} |
| 35 | + cancel-in-progress: true |
| 36 | + |
| 37 | +jobs: |
| 38 | + content: |
| 39 | + name: Blender ${{ matrix.series }} content smoke |
| 40 | + runs-on: ubuntu-latest |
| 41 | + timeout-minutes: 30 |
| 42 | + strategy: |
| 43 | + fail-fast: false |
| 44 | + matrix: |
| 45 | + series: ["5.2", "4.5"] |
| 46 | + steps: |
| 47 | + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 |
| 48 | + |
| 49 | + - name: Install Blender runtime libraries |
| 50 | + run: | |
| 51 | + set -euo pipefail |
| 52 | + sudo apt-get update |
| 53 | + sudo apt-get install -y --no-install-recommends \ |
| 54 | + xvfb libgl1 libegl1 libxrender1 libxxf86vm1 libxfixes3 libxi6 \ |
| 55 | + libxkbcommon0 libsm6 libice6 |
| 56 | +
|
| 57 | + - name: Resolve Blender ${{ matrix.series }} |
| 58 | + id: resolve |
| 59 | + run: | |
| 60 | + set -euo pipefail |
| 61 | + series="${{ matrix.series }}" |
| 62 | + base="https://download.blender.org/release/Blender${series}/" |
| 63 | + file=$(curl -fsSL "$base" \ |
| 64 | + | grep -oE "blender-${series}\.[0-9]+-linux-x64\.tar\.xz" \ |
| 65 | + | sort -V | uniq | tail -1) |
| 66 | + if [ -z "$file" ]; then |
| 67 | + echo "::error::Could not resolve a linux-x64 build for Blender ${series} at $base" |
| 68 | + exit 1 |
| 69 | + fi |
| 70 | + version="${file#blender-}" |
| 71 | + version="${version%-linux-x64.tar.xz}" |
| 72 | + echo "base=$base" >> "$GITHUB_OUTPUT" |
| 73 | + echo "file=$file" >> "$GITHUB_OUTPUT" |
| 74 | + echo "version=$version" >> "$GITHUB_OUTPUT" |
| 75 | + echo "Resolved Blender $version" |
| 76 | +
|
| 77 | + - name: Restore Blender ${{ steps.resolve.outputs.version }} from cache |
| 78 | + id: bl-cache |
| 79 | + uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 |
| 80 | + with: |
| 81 | + path: ${{ runner.temp }}/bl |
| 82 | + key: blender-${{ steps.resolve.outputs.version }}-linux-x64 |
| 83 | + |
| 84 | + - name: Download Blender and verify its published sha256 |
| 85 | + if: steps.bl-cache.outputs.cache-hit != 'true' |
| 86 | + run: | |
| 87 | + set -euo pipefail |
| 88 | + base="${{ steps.resolve.outputs.base }}" |
| 89 | + file="${{ steps.resolve.outputs.file }}" |
| 90 | + version="${{ steps.resolve.outputs.version }}" |
| 91 | + mkdir -p "$RUNNER_TEMP/bl" |
| 92 | + curl -fSL --retry 3 -o "$RUNNER_TEMP/bl.tar.xz" "${base}${file}" |
| 93 | + curl -fsSL --retry 3 -o "$RUNNER_TEMP/bl.sha256" "${base}blender-${version}.sha256" |
| 94 | + expected=$(grep -E " ${file}$" "$RUNNER_TEMP/bl.sha256" | awk '{print $1}') |
| 95 | + if [ -z "$expected" ]; then |
| 96 | + echo "::error::no published sha256 for ${file}" |
| 97 | + exit 1 |
| 98 | + fi |
| 99 | + echo "${expected} $RUNNER_TEMP/bl.tar.xz" | sha256sum -c - \ |
| 100 | + || { echo "::error::sha256 mismatch for ${file}; refusing to extract"; exit 1; } |
| 101 | + tar -xf "$RUNNER_TEMP/bl.tar.xz" -C "$RUNNER_TEMP/bl" |
| 102 | +
|
| 103 | + - name: Locate Blender binary |
| 104 | + run: | |
| 105 | + set -euo pipefail |
| 106 | + bl=$(find "$RUNNER_TEMP/bl" -maxdepth 2 -type f -name blender | head -1) |
| 107 | + if [ -z "$bl" ]; then |
| 108 | + echo "::error::blender binary not found" |
| 109 | + exit 1 |
| 110 | + fi |
| 111 | + echo "BLENDER=$bl" >> "$GITHUB_ENV" |
| 112 | + "$bl" --version | head -1 | grep -q "Blender ${{ matrix.series }}\." \ |
| 113 | + || { echo "::error::version does not match series ${{ matrix.series }}"; exit 1; } |
| 114 | +
|
| 115 | + - name: Run every snippet (and its falsifier) and every tagged SKILL.md block |
| 116 | + run: | |
| 117 | + set -euo pipefail |
| 118 | + xvfb-run -a "$BLENDER" --background --factory-startup --python-exit-code 1 \ |
| 119 | + --python tests/smoke/run_content.py |
0 commit comments