mirror of
https://github.com/suitenumerique/docs.git
synced 2026-08-22 07:32:23 +02:00
169 lines
5.1 KiB
YAML
169 lines
5.1 KiB
YAML
name: Frontend Workflow
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
branches:
|
|
- "*"
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
|
|
install-dependencies:
|
|
uses: ./.github/workflows/dependencies.yml
|
|
with:
|
|
node_version: '22.x'
|
|
with-front-dependencies-installation: true
|
|
|
|
test-front:
|
|
needs: install-dependencies
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
|
|
with:
|
|
node-version: "22.x"
|
|
|
|
- name: Restore the frontend cache
|
|
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
|
|
with:
|
|
path: "src/frontend/**/node_modules"
|
|
key: front-node_modules-${{ hashFiles('src/frontend/**/yarn.lock') }}
|
|
fail-on-cache-miss: true
|
|
|
|
- name: Test App
|
|
run: cd src/frontend/ && yarn test
|
|
|
|
lint-front:
|
|
runs-on: ubuntu-latest
|
|
needs: install-dependencies
|
|
permissions:
|
|
contents: read
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
|
|
with:
|
|
node-version: "22.x"
|
|
- name: Restore the frontend cache
|
|
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
|
|
with:
|
|
path: "src/frontend/**/node_modules"
|
|
key: front-node_modules-${{ hashFiles('src/frontend/**/yarn.lock') }}
|
|
fail-on-cache-miss: true
|
|
|
|
- name: Check linting
|
|
run: cd src/frontend/ && yarn lint
|
|
|
|
test-e2e-chromium:
|
|
uses: ./.github/workflows/e2e-tests.yml
|
|
with:
|
|
browser-name: chromium
|
|
projects: --project=chromium
|
|
timeout-minutes: 25
|
|
|
|
test-e2e-other-browser:
|
|
needs: test-e2e-chromium
|
|
uses: ./.github/workflows/e2e-tests.yml
|
|
with:
|
|
browser-name: other-browser
|
|
projects: --project=firefox --project=webkit
|
|
timeout-minutes: 30
|
|
|
|
bundle-size-check:
|
|
runs-on: ubuntu-latest
|
|
needs: install-dependencies
|
|
if: github.event_name == 'pull_request'
|
|
permissions:
|
|
contents: read
|
|
pull-requests: write
|
|
issues: write
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
|
|
|
- name: Detect relevant changes
|
|
id: changes
|
|
uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4
|
|
with:
|
|
filters: |
|
|
lock:
|
|
- 'src/frontend/**/yarn.lock'
|
|
app:
|
|
- 'src/frontend/apps/impress/**'
|
|
|
|
- name: Restore the frontend cache
|
|
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
|
|
with:
|
|
path: "src/frontend/**/node_modules"
|
|
key: front-node_modules-${{ hashFiles('src/frontend/**/yarn.lock') }}
|
|
fail-on-cache-miss: true
|
|
|
|
- name: Setup Node.js
|
|
if: steps.changes.outputs.lock == 'true' || steps.changes.outputs.app == 'true'
|
|
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
|
|
with:
|
|
node-version: "22.x"
|
|
|
|
- name: Check bundle size changes
|
|
if: steps.changes.outputs.lock == 'true' || steps.changes.outputs.app == 'true'
|
|
uses: preactjs/compressed-size-action@66325aad6443cb7cf89c4bfcd414aea2367cda94 # v2
|
|
with:
|
|
repo-token: "${{ secrets.GITHUB_TOKEN }}"
|
|
build-script: "app:build"
|
|
pattern: "apps/impress/out/**/*.{css,js,html}"
|
|
exclude: "{**/*.map,**/node_modules/**}"
|
|
minimum-change-threshold: 500
|
|
compression: "gzip"
|
|
cwd: "./src/frontend"
|
|
show-total: true
|
|
strip-hash: "[-_.][a-f0-9]{8,}(?=\\.(?:js|css|html)$)"
|
|
omit-unchanged: true
|
|
install-script: "yarn install --frozen-lockfile"
|
|
|
|
uikit-theme-checker:
|
|
runs-on: ubuntu-latest
|
|
needs: install-dependencies
|
|
permissions:
|
|
contents: read
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
|
|
with:
|
|
node-version: "22.x"
|
|
- name: Restore the frontend cache
|
|
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
|
|
with:
|
|
path: "src/frontend/**/node_modules"
|
|
key: front-node_modules-${{ hashFiles('src/frontend/**/yarn.lock') }}
|
|
fail-on-cache-miss: true
|
|
|
|
- name: Build theme
|
|
run: cd src/frontend/apps/impress && yarn build-theme
|
|
|
|
- name: Ensure theme is up to date
|
|
shell: bash
|
|
run: |
|
|
if [[ -n "$(git status --porcelain)" ]]; then
|
|
echo "Error: build-theme produced git changes (tracked or untracked)."
|
|
echo "--- git status --porcelain ---"
|
|
git status --porcelain
|
|
echo "--- git diff ---"
|
|
git --no-pager diff
|
|
exit 1
|
|
fi
|