mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-04-02 22:28:51 +00:00
Bumps the actions group with 9 updates: | Package | From | To | | --- | --- | --- | | [dorny/paths-filter](https://github.com/dorny/paths-filter) | `3.0.2` | `4.0.1` | | [actions/cache](https://github.com/actions/cache) | `5.0.3` | `5.0.4` | | [actions/download-artifact](https://github.com/actions/download-artifact) | `8.0.0` | `8.0.1` | | [actions/configure-pages](https://github.com/actions/configure-pages) | `5.0.0` | `6.0.0` | | [actions/deploy-pages](https://github.com/actions/deploy-pages) | `4.0.5` | `5.0.0` | | [pnpm/action-setup](https://github.com/pnpm/action-setup) | `4.2.0` | `5.0.0` | | [j178/prek-action](https://github.com/j178/prek-action) | `1.1.1` | `2.0.1` | | [release-drafter/release-drafter](https://github.com/release-drafter/release-drafter) | `6.2.0` | `7.1.1` | | [shogo82148/actions-upload-release-asset](https://github.com/shogo82148/actions-upload-release-asset) | `1.9.2` | `1.10.0` | Updates `dorny/paths-filter` from 3.0.2 to 4.0.1 - [Release notes](https://github.com/dorny/paths-filter/releases) - [Changelog](https://github.com/dorny/paths-filter/blob/master/CHANGELOG.md) - [Commits](de90cc6fb3...fbd0ab8f3e) Updates `actions/cache` from 5.0.3 to 5.0.4 - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](cdf6c1fa76...668228422a) Updates `actions/download-artifact` from 8.0.0 to 8.0.1 - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](70fc10c6e5...3e5f45b2cf) Updates `actions/configure-pages` from 5.0.0 to 6.0.0 - [Release notes](https://github.com/actions/configure-pages/releases) - [Commits](983d7736d9...45bfe0192c) Updates `actions/deploy-pages` from 4.0.5 to 5.0.0 - [Release notes](https://github.com/actions/deploy-pages/releases) - [Commits](d6db90164a...cd2ce8fcbc) Updates `pnpm/action-setup` from 4.2.0 to 5.0.0 - [Release notes](https://github.com/pnpm/action-setup/releases) - [Commits](41ff726559...fc06bc1257) Updates `j178/prek-action` from 1.1.1 to 2.0.1 - [Release notes](https://github.com/j178/prek-action/releases) - [Commits](0bb87d7f00...53276d8b0d) Updates `release-drafter/release-drafter` from 6.2.0 to 7.1.1 - [Release notes](https://github.com/release-drafter/release-drafter/releases) - [Commits](6db134d15f...139054aeaa) Updates `shogo82148/actions-upload-release-asset` from 1.9.2 to 1.10.0 - [Release notes](https://github.com/shogo82148/actions-upload-release-asset/releases) - [Commits](8f6863c6c8...96bc1f0cb8) --- updated-dependencies: - dependency-name: dorny/paths-filter dependency-version: 4.0.1 dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: actions/cache dependency-version: 5.0.4 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions - dependency-name: actions/download-artifact dependency-version: 8.0.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions - dependency-name: actions/configure-pages dependency-version: 6.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: actions/deploy-pages dependency-version: 5.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: pnpm/action-setup dependency-version: 5.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: j178/prek-action dependency-version: 2.0.1 dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: release-drafter/release-drafter dependency-version: 7.1.1 dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: shogo82148/actions-upload-release-asset dependency-version: 1.10.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
274 lines
10 KiB
YAML
274 lines
10 KiB
YAML
name: Frontend Tests
|
|
on:
|
|
push:
|
|
branches-ignore:
|
|
- 'translations**'
|
|
pull_request:
|
|
branches-ignore:
|
|
- 'translations**'
|
|
workflow_dispatch:
|
|
concurrency:
|
|
group: frontend-${{ github.event.pull_request.number || github.ref }}
|
|
cancel-in-progress: true
|
|
jobs:
|
|
changes:
|
|
name: Detect Frontend Changes
|
|
runs-on: ubuntu-slim
|
|
outputs:
|
|
frontend_changed: ${{ steps.force.outputs.run_all == 'true' || steps.filter.outputs.frontend == 'true' }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Decide run mode
|
|
id: force
|
|
run: |
|
|
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
|
|
echo "run_all=true" >> "$GITHUB_OUTPUT"
|
|
elif [[ "${{ github.event_name }}" == "push" && ( "${{ github.ref_name }}" == "main" || "${{ github.ref_name }}" == "dev" ) ]]; then
|
|
echo "run_all=true" >> "$GITHUB_OUTPUT"
|
|
else
|
|
echo "run_all=false" >> "$GITHUB_OUTPUT"
|
|
fi
|
|
- name: Set diff range
|
|
id: range
|
|
if: steps.force.outputs.run_all != 'true'
|
|
run: |
|
|
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
|
|
echo "base=${{ github.event.pull_request.base.sha }}" >> "$GITHUB_OUTPUT"
|
|
elif [[ "${{ github.event.created }}" == "true" ]]; then
|
|
echo "base=${{ github.event.repository.default_branch }}" >> "$GITHUB_OUTPUT"
|
|
else
|
|
echo "base=${{ github.event.before }}" >> "$GITHUB_OUTPUT"
|
|
fi
|
|
echo "ref=${{ github.sha }}" >> "$GITHUB_OUTPUT"
|
|
- name: Detect changes
|
|
id: filter
|
|
if: steps.force.outputs.run_all != 'true'
|
|
uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
|
|
with:
|
|
base: ${{ steps.range.outputs.base }}
|
|
ref: ${{ steps.range.outputs.ref }}
|
|
filters: |
|
|
frontend:
|
|
- 'src-ui/**'
|
|
- '.github/workflows/ci-frontend.yml'
|
|
install-dependencies:
|
|
needs: changes
|
|
if: needs.changes.outputs.frontend_changed == 'true'
|
|
name: Install Dependencies
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
- name: Install pnpm
|
|
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
|
|
with:
|
|
version: 10
|
|
- name: Use Node.js 24
|
|
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
|
|
with:
|
|
node-version: 24.x
|
|
cache: 'pnpm'
|
|
cache-dependency-path: 'src-ui/pnpm-lock.yaml'
|
|
- name: Cache frontend dependencies
|
|
id: cache-frontend-deps
|
|
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
|
|
with:
|
|
path: |
|
|
~/.pnpm-store
|
|
~/.cache
|
|
key: ${{ runner.os }}-frontend-${{ hashFiles('src-ui/pnpm-lock.yaml') }}
|
|
- name: Install dependencies
|
|
run: cd src-ui && pnpm install
|
|
lint:
|
|
name: Lint
|
|
needs: [changes, install-dependencies]
|
|
if: needs.changes.outputs.frontend_changed == 'true'
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
- name: Install pnpm
|
|
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
|
|
with:
|
|
version: 10
|
|
- name: Use Node.js 24
|
|
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
|
|
with:
|
|
node-version: 24.x
|
|
cache: 'pnpm'
|
|
cache-dependency-path: 'src-ui/pnpm-lock.yaml'
|
|
- name: Cache frontend dependencies
|
|
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
|
|
with:
|
|
path: |
|
|
~/.pnpm-store
|
|
~/.cache
|
|
key: ${{ runner.os }}-frontend-${{ hashFiles('src-ui/pnpm-lock.yaml') }}
|
|
- name: Re-link Angular CLI
|
|
run: cd src-ui && pnpm link @angular/cli
|
|
- name: Run lint
|
|
run: cd src-ui && pnpm run lint
|
|
unit-tests:
|
|
name: "Unit Tests (${{ matrix.shard-index }}/${{ matrix.shard-count }})"
|
|
needs: [changes, install-dependencies]
|
|
if: needs.changes.outputs.frontend_changed == 'true'
|
|
runs-on: ubuntu-24.04
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
node-version: [24.x]
|
|
shard-index: [1, 2, 3, 4]
|
|
shard-count: [4]
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
- name: Install pnpm
|
|
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
|
|
with:
|
|
version: 10
|
|
- name: Use Node.js 24
|
|
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
|
|
with:
|
|
node-version: 24.x
|
|
cache: 'pnpm'
|
|
cache-dependency-path: 'src-ui/pnpm-lock.yaml'
|
|
- name: Cache frontend dependencies
|
|
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
|
|
with:
|
|
path: |
|
|
~/.pnpm-store
|
|
~/.cache
|
|
key: ${{ runner.os }}-frontend-${{ hashFiles('src-ui/pnpm-lock.yaml') }}
|
|
- name: Re-link Angular CLI
|
|
run: cd src-ui && pnpm link @angular/cli
|
|
- name: Run Jest unit tests
|
|
run: cd src-ui && pnpm run test --max-workers=2 --shard=${{ matrix.shard-index }}/${{ matrix.shard-count }}
|
|
- name: Upload test results to Codecov
|
|
if: always()
|
|
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
|
|
with:
|
|
flags: frontend-node-${{ matrix.node-version }}
|
|
directory: src-ui/
|
|
report_type: test_results
|
|
- name: Upload coverage to Codecov
|
|
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
|
|
with:
|
|
flags: frontend-node-${{ matrix.node-version }}
|
|
directory: src-ui/coverage/
|
|
e2e-tests:
|
|
name: "E2E Tests (${{ matrix.shard-index }}/${{ matrix.shard-count }})"
|
|
needs: [changes, install-dependencies]
|
|
if: needs.changes.outputs.frontend_changed == 'true'
|
|
runs-on: ubuntu-24.04
|
|
container: mcr.microsoft.com/playwright:v1.58.2-noble
|
|
env:
|
|
PLAYWRIGHT_BROWSERS_PATH: /ms-playwright
|
|
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
node-version: [24.x]
|
|
shard-index: [1, 2]
|
|
shard-count: [2]
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
- name: Install pnpm
|
|
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
|
|
with:
|
|
version: 10
|
|
- name: Use Node.js 24
|
|
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
|
|
with:
|
|
node-version: 24.x
|
|
cache: 'pnpm'
|
|
cache-dependency-path: 'src-ui/pnpm-lock.yaml'
|
|
- name: Cache frontend dependencies
|
|
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
|
|
with:
|
|
path: |
|
|
~/.pnpm-store
|
|
~/.cache
|
|
key: ${{ runner.os }}-frontend-${{ hashFiles('src-ui/pnpm-lock.yaml') }}
|
|
- name: Re-link Angular CLI
|
|
run: cd src-ui && pnpm link @angular/cli
|
|
- name: Install dependencies
|
|
run: cd src-ui && pnpm install --no-frozen-lockfile
|
|
- name: Run Playwright E2E tests
|
|
run: cd src-ui && pnpm exec playwright test --shard ${{ matrix.shard-index }}/${{ matrix.shard-count }}
|
|
bundle-analysis:
|
|
name: Bundle Analysis
|
|
needs: [changes, unit-tests, e2e-tests]
|
|
if: needs.changes.outputs.frontend_changed == 'true'
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
fetch-depth: 2
|
|
- name: Install pnpm
|
|
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
|
|
with:
|
|
version: 10
|
|
- name: Use Node.js 24
|
|
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
|
|
with:
|
|
node-version: 24.x
|
|
cache: 'pnpm'
|
|
cache-dependency-path: 'src-ui/pnpm-lock.yaml'
|
|
- name: Cache frontend dependencies
|
|
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
|
|
with:
|
|
path: |
|
|
~/.pnpm-store
|
|
~/.cache
|
|
key: ${{ runner.os }}-frontend-${{ hashFiles('src-ui/pnpm-lock.yaml') }}
|
|
- name: Re-link Angular CLI
|
|
run: cd src-ui && pnpm link @angular/cli
|
|
- name: Build and analyze
|
|
env:
|
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
|
run: cd src-ui && pnpm run build --configuration=production
|
|
gate:
|
|
name: Frontend CI Gate
|
|
needs: [changes, install-dependencies, lint, unit-tests, e2e-tests, bundle-analysis]
|
|
if: always()
|
|
runs-on: ubuntu-slim
|
|
steps:
|
|
- name: Check gate
|
|
run: |
|
|
if [[ "${{ needs.changes.outputs.frontend_changed }}" != "true" ]]; then
|
|
echo "No frontend-relevant changes detected."
|
|
exit 0
|
|
fi
|
|
|
|
if [[ "${{ needs['install-dependencies'].result }}" != "success" ]]; then
|
|
echo "::error::Frontend install job result: ${{ needs['install-dependencies'].result }}"
|
|
exit 1
|
|
fi
|
|
|
|
if [[ "${{ needs.lint.result }}" != "success" ]]; then
|
|
echo "::error::Frontend lint job result: ${{ needs.lint.result }}"
|
|
exit 1
|
|
fi
|
|
|
|
if [[ "${{ needs['unit-tests'].result }}" != "success" ]]; then
|
|
echo "::error::Frontend unit-tests job result: ${{ needs['unit-tests'].result }}"
|
|
exit 1
|
|
fi
|
|
|
|
if [[ "${{ needs['e2e-tests'].result }}" != "success" ]]; then
|
|
echo "::error::Frontend e2e-tests job result: ${{ needs['e2e-tests'].result }}"
|
|
exit 1
|
|
fi
|
|
|
|
if [[ "${{ needs['bundle-analysis'].result }}" != "success" ]]; then
|
|
echo "::error::Frontend bundle-analysis job result: ${{ needs['bundle-analysis'].result }}"
|
|
exit 1
|
|
fi
|
|
|
|
echo "Frontend checks passed."
|