chore: faster web linting (#28303)

pull/28307/head
Jason Rasmussen 2026-05-08 16:55:14 -04:00 committed by GitHub
parent 25a6a38b30
commit 8a024e2b50
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 37 additions and 45 deletions

View File

@ -188,28 +188,22 @@ jobs:
with: with:
persist-credentials: false persist-credentials: false
token: ${{ steps.token.outputs.token }} token: ${{ steps.token.outputs.token }}
- name: Setup pnpm
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0 - name: Setup Mise
- name: Setup Node uses: immich-app/devtools/actions/use-mise@01a4d354b70f99a6baf4a1b72827f6d4922e4978 # use-mise-action-v2.0.0
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with: with:
node-version-file: '.nvmrc' github_token: ${{ steps.token.outputs.token }}
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
- name: Run setup typescript-sdk - name: Run setup typescript-sdk
run: pnpm install --frozen-lockfile && pnpm build run: mise run //:sdk:install && mise run //:sdk:build
working-directory: ./open-api/typescript-sdk
- name: Run pnpm install - name: Run pnpm install
run: pnpm rebuild && pnpm install --frozen-lockfile run: pnpm install --frozen-lockfile
- name: Run linter - name: Run linter
run: pnpm lint run: pnpm lint
if: ${{ !cancelled() }} if: ${{ !cancelled() }}
- name: Run formatter
run: pnpm format
if: ${{ !cancelled() }}
- name: Run svelte checks
run: pnpm check:svelte
if: ${{ !cancelled() }}
web-unit-tests: web-unit-tests:
name: Test Web name: Test Web
needs: pre-job needs: pre-job
@ -232,25 +226,15 @@ jobs:
with: with:
persist-credentials: false persist-credentials: false
token: ${{ steps.token.outputs.token }} token: ${{ steps.token.outputs.token }}
- name: Setup pnpm
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0 - name: Setup Mise
- name: Setup Node uses: immich-app/devtools/actions/use-mise@01a4d354b70f99a6baf4a1b72827f6d4922e4978 # use-mise-action-v2.0.0
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with: with:
node-version-file: '.nvmrc' github_token: ${{ steps.token.outputs.token }}
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml' - name: Run ci-unit
- name: Run setup typescript-sdk run: mise run ci-unit
run: pnpm install --frozen-lockfile && pnpm build
working-directory: ./open-api/typescript-sdk
- name: Run npm install
run: pnpm install --frozen-lockfile
- name: Run tsc
run: pnpm check:typescript
if: ${{ !cancelled() }}
- name: Run unit tests & coverage
run: pnpm test
if: ${{ !cancelled() }}
i18n-tests: i18n-tests:
name: Test i18n name: Test i18n
needs: pre-job needs: pre-job
@ -270,24 +254,25 @@ jobs:
with: with:
persist-credentials: false persist-credentials: false
token: ${{ steps.token.outputs.token }} token: ${{ steps.token.outputs.token }}
- name: Setup pnpm
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0 - name: Setup Mise
- name: Setup Node uses: immich-app/devtools/actions/use-mise@01a4d354b70f99a6baf4a1b72827f6d4922e4978 # use-mise-action-v2.0.0
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with: with:
node-version-file: '.nvmrc' github_token: ${{ steps.token.outputs.token }}
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
- name: Install dependencies - name: Install dependencies
run: pnpm --filter=immich-i18n install --frozen-lockfile run: pnpm --filter=immich-i18n install --frozen-lockfile
- name: Format - name: Format
run: pnpm --filter=immich-i18n format:fix run: pnpm --filter=immich-i18n format:fix
- name: Find file changes - name: Find file changes
uses: tj-actions/verify-changed-files@a1c6acee9df209257a246f2cc6ae8cb6581c1edf # v20.0.4 uses: tj-actions/verify-changed-files@a1c6acee9df209257a246f2cc6ae8cb6581c1edf # v20.0.4
id: verify-changed-files id: verify-changed-files
with: with:
files: | files: |
i18n/** i18n/**
- name: Verify files have not changed - name: Verify files have not changed
if: steps.verify-changed-files.outputs.files_changed == 'true' if: steps.verify-changed-files.outputs.files_changed == 'true'
env: env:
@ -296,6 +281,7 @@ jobs:
echo "ERROR: i18n files not up to date!" echo "ERROR: i18n files not up to date!"
echo "Changed files: ${CHANGED_FILES}" echo "Changed files: ${CHANGED_FILES}"
exit 1 exit 1
e2e-tests-lint: e2e-tests-lint:
name: End-to-End Lint name: End-to-End Lint
needs: pre-job needs: pre-job
@ -397,10 +383,10 @@ jobs:
node-version-file: '.nvmrc' node-version-file: '.nvmrc'
cache: 'pnpm' cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml' cache-dependency-path: '**/pnpm-lock.yaml'
- name: Run setup typescript-sdk
- name: Setup typescript-sdk
run: pnpm install --frozen-lockfile && pnpm build run: pnpm install --frozen-lockfile && pnpm build
working-directory: ./open-api/typescript-sdk working-directory: ./open-api/typescript-sdk
if: ${{ !cancelled() }}
- name: Run setup web - name: Run setup web
run: pnpm install --frozen-lockfile && pnpm exec svelte-kit sync run: pnpm install --frozen-lockfile && pnpm exec svelte-kit sync

View File

@ -42,11 +42,17 @@ run = "pnpm run check:svelte"
[tasks.check] [tasks.check]
run = { tasks = [":check-typescript", ":check-svelte"] } run = { tasks = [":check-typescript", ":check-svelte"] }
[tasks.checklist] [tasks.ci-unit]
depends = ["//:sdk:install", "//:sdk:build"]
run = [ run = [
{ task = ":install" }, { task = ":install" },
{ task = ":format" }, { task = ":format" },
{ task = ":check" }, { task = ":check" },
{ task = ":test --run" }, { task = ":test --run" },
]
[tasks.checklist]
run = [
{ task = ":ci-unit" },
{ task = ":lint" }, { task = ":lint" },
] ]

View File

@ -14,7 +14,7 @@
"check:watch": "pnpm run check:svelte --watch", "check:watch": "pnpm run check:svelte --watch",
"check:code": "pnpm run format && pnpm run lint && pnpm run check:svelte && pnpm run check:typescript", "check:code": "pnpm run format && pnpm run lint && pnpm run check:svelte && pnpm run check:typescript",
"check:all": "pnpm run check:code && pnpm run test:cov", "check:all": "pnpm run check:code && pnpm run test:cov",
"lint": "eslint . --max-warnings 0 --concurrency 4", "lint": "eslint . --max-warnings 0 --concurrency 6",
"lint:fix": "pnpm run lint --fix", "lint:fix": "pnpm run lint --fix",
"format": "prettier --cache --check .", "format": "prettier --cache --check .",
"format:fix": "prettier --cache --write --list-different .", "format:fix": "prettier --cache --write --list-different .",