Skip to content

Commit 3c279d4

Browse files
Harden CI workflow orchestration
(cherry picked from commit 5c9e83a)
1 parent 7732af0 commit 3c279d4

10 files changed

Lines changed: 1176 additions & 332 deletions
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Setup CI Environment
2+
description: Prepare Node, shellcheck, npm cache, and Playwright cache for FolderView Plus workflows.
3+
4+
inputs:
5+
node-version:
6+
description: Node.js version to install
7+
required: false
8+
default: '20'
9+
cache-key-suffix:
10+
description: Extra cache key suffix to allow targeted cache busting
11+
required: false
12+
default: 'v1'
13+
14+
runs:
15+
using: composite
16+
steps:
17+
- name: Setup Node
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: ${{ inputs.node-version }}
21+
22+
- name: Restore npm cache
23+
uses: actions/cache@v4
24+
with:
25+
path: ~/.npm
26+
key: ${{ runner.os }}-fvplus-npm-${{ inputs.cache-key-suffix }}-${{ hashFiles('.github/actions/setup-ci-env/action.yml', 'scripts/run_ci_suite.sh') }}
27+
restore-keys: |
28+
${{ runner.os }}-fvplus-npm-${{ inputs.cache-key-suffix }}-
29+
${{ runner.os }}-fvplus-npm-
30+
31+
- name: Restore Playwright browser cache
32+
uses: actions/cache@v4
33+
with:
34+
path: ~/.cache/ms-playwright
35+
key: ${{ runner.os }}-fvplus-playwright-${{ inputs.cache-key-suffix }}-${{ hashFiles('.github/actions/setup-ci-env/action.yml', 'scripts/run_ci_suite.sh') }}
36+
restore-keys: |
37+
${{ runner.os }}-fvplus-playwright-${{ inputs.cache-key-suffix }}-
38+
${{ runner.os }}-fvplus-playwright-
39+
40+
- name: Install shellcheck
41+
shell: bash
42+
run: |
43+
set -euo pipefail
44+
if command -v shellcheck >/dev/null 2>&1; then
45+
shellcheck --version
46+
exit 0
47+
fi
48+
sudo apt-get update
49+
sudo apt-get install -y shellcheck

.github/workflows/backmerge-main-to-dev.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ jobs:
2323
with:
2424
fetch-depth: 0
2525

26+
- name: Setup CI environment
27+
uses: ./.github/actions/setup-ci-env
28+
2629
- name: Configure git identity
2730
run: |
2831
git config user.name "github-actions[bot]"
@@ -32,6 +35,33 @@ jobs:
3235
run: |
3336
bash scripts/sync_main_to_dev.sh
3437
38+
- name: Validate merged dev state before push
39+
env:
40+
FVPLUS_UNRAID_MATRIX: ${{ secrets.FVPLUS_UNRAID_MATRIX }}
41+
FVPLUS_I18N_STRICT: '1'
42+
FVPLUS_DEAD_CODE_STRICT: '1'
43+
FVPLUS_REQUIRE_PERF_BASELINE: '1'
44+
FVPLUS_BROWSER_SMOKE_URL: ${{ secrets.FVPLUS_BROWSER_SMOKE_URL }}
45+
FVPLUS_BROWSER_SMOKE_REQUIRED: '0'
46+
FVPLUS_BROWSER_SMOKE_TIMEOUT_MS: '90000'
47+
FVPLUS_BROWSER_SMOKE_IGNORE_HTTPS: '1'
48+
FVPLUS_BROWSER_SMOKE_REQUIRE_FOLDER_EDITOR: '1'
49+
FVPLUS_BROWSER_SMOKE_REQUIRE_RUNTIME_ROWS: '1'
50+
FVPLUS_BROWSER_SMOKE_RUNTIME_GAP_MAX: '30'
51+
FVPLUS_BROWSER_SMOKE_ARTIFACT_DIR: ${{ github.workspace }}/tmp/browser-smoke-artifacts
52+
FVPLUS_THEME_MATRIX_URLS: ${{ secrets.FVPLUS_THEME_MATRIX_URLS }}
53+
FVPLUS_THEME_MATRIX_REQUIRED: '0'
54+
FVPLUS_THEME_REQUIRED_LABELS: 'black,white'
55+
FVPLUS_THEME_SMOKE_TIMEOUT_MS: '90000'
56+
FVPLUS_THEME_SMOKE_IGNORE_HTTPS: '1'
57+
FVPLUS_THEME_SMOKE_BROWSERS: 'chromium,firefox,webkit'
58+
FVPLUS_THEME_SMOKE_ZOOMS: '1,1.25,1.5'
59+
FVPLUS_THEME_SMOKE_ARTIFACT_DIR: ${{ github.workspace }}/tmp/browser-smoke-artifacts/theme-matrix
60+
FVPLUS_PLAYWRIGHT_INSTALL_WITH_DEPS: '1'
61+
run: |
62+
chmod +x scripts/run_ci_suite.sh
63+
bash scripts/run_ci_suite.sh
64+
3565
- name: Push dev when updated
3666
run: |
3767
git fetch origin dev
@@ -42,3 +72,25 @@ jobs:
4272
exit 0
4373
fi
4474
git push origin dev
75+
76+
- name: Collect back-merge debug artifacts on failure
77+
if: failure()
78+
shell: bash
79+
run: |
80+
set -euo pipefail
81+
mkdir -p tmp/backmerge-debug
82+
git status --short --branch > tmp/backmerge-debug/git-status.txt || true
83+
git diff --stat > tmp/backmerge-debug/git-diff-stat.txt || true
84+
git log --oneline --decorate -10 > tmp/backmerge-debug/git-log.txt || true
85+
86+
- name: Upload back-merge debug artifacts on failure
87+
if: failure()
88+
uses: actions/upload-artifact@v4
89+
with:
90+
name: backmerge-debug-${{ github.run_id }}-${{ github.job }}
91+
if-no-files-found: ignore
92+
path: |
93+
tmp/backmerge-debug/**
94+
tmp/browser-smoke-artifacts/**
95+
*.log
96+
scripts/*.log

0 commit comments

Comments
 (0)