feat: composite action for frontend setup

This commit is contained in:
Dominik Pschenitschni
2025-04-02 12:05:40 +02:00
committed by kolaente
parent 1c2cdf9240
commit 1deb674da1
3 changed files with 31 additions and 72 deletions

View File

@@ -0,0 +1,18 @@
name: Setup Frontend
description: Common setup for frontend jobs using pnpm
runs:
using: "composite"
steps:
- uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4
with:
run_install: false
package_json_file: frontend/package.json
- uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4
with:
node-version-file: frontend/.nvmrc
cache: 'pnpm'
cache-dependency-path: frontend/pnpm-lock.yaml
- name: Install dependencies
working-directory: frontend
run: pnpm install
shell: bash

View File

@@ -55,22 +55,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4
name: Install pnpm
with:
run_install: false
package_json_file: frontend/package.json
- name: Install Node.js
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4
with:
node-version-file: frontend/.nvmrc
cache: 'pnpm'
cache-dependency-path: frontend/pnpm-lock.yaml
- name: Install dependencies
- uses: ./.github/actions/setup-frontend
- name: Build frontend
working-directory: frontend
run: |
pnpm install
pnpm build
run: pnpm build
- name: Store frontend dist
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:

View File

@@ -226,65 +226,29 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4
name: Install pnpm
with:
run_install: false
package_json_file: frontend/package.json
- name: Install Node.js
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4
with:
node-version-file: frontend/.nvmrc
cache: 'pnpm'
cache-dependency-path: frontend/pnpm-lock.yaml
- uses: ./.github/actions/setup-frontend
- name: Lint
run: |
cd frontend
pnpm install
pnpm lint
working-directory: frontend
run: pnpm lint
frontend-typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4
name: Install pnpm
with:
run_install: false
package_json_file: frontend/package.json
- name: Install Node.js
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4
with:
node-version-file: frontend/.nvmrc
cache: 'pnpm'
cache-dependency-path: frontend/pnpm-lock.yaml
- uses: ./.github/actions/setup-frontend
- name: Typecheck
continue-on-error: true
run: |
cd frontend
pnpm install
pnpm typecheck
working-directory: frontend
run: pnpm typecheck
test-frontend-unit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4
name: Install pnpm
with:
run_install: false
package_json_file: frontend/package.json
- name: Install Node.js
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4
with:
node-version-file: frontend/.nvmrc
cache: 'pnpm'
cache-dependency-path: frontend/pnpm-lock.yaml
- uses: ./.github/actions/setup-frontend
- name: Run unit tests
run: |
cd frontend
pnpm install
pnpm test:unit
working-directory: frontend
run: pnpm test:unit
test-frontend-e2e:
runs-on: ubuntu-latest
@@ -292,17 +256,7 @@ jobs:
- api-build
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4
name: Install pnpm
with:
run_install: false
package_json_file: frontend/package.json
- name: Install Node.js
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4
with:
node-version-file: frontend/.nvmrc
cache: 'pnpm'
cache-dependency-path: frontend/pnpm-lock.yaml
- uses: ./.github/actions/setup-frontend
- name: Download Vikunja Binary
uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4
with:
@@ -310,7 +264,6 @@ jobs:
- name: Build frontend for test
run: |
cd frontend
pnpm install
pnpm cypress install
pnpm build:test
- name: Run api