mirror of
https://github.com/immich-app/devtools.git
synced 2026-09-30 21:27:48 +08:00
69 lines
1.8 KiB
YAML
69 lines
1.8 KiB
YAML
name: Scripts
|
|
on:
|
|
workflow_dispatch:
|
|
pull_request:
|
|
push:
|
|
branches: [main]
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
permissions: {}
|
|
|
|
jobs:
|
|
pre-job:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
outputs:
|
|
should_run: ${{ steps.check.outputs.should_run }}
|
|
steps:
|
|
- name: Check what should run
|
|
id: check
|
|
uses: immich-app/devtools/actions/pre-job@75493d49052d536863fc96100086782c5279b145 # pre-job-action-v2.1.1
|
|
with:
|
|
github-token: ${{ github.token }}
|
|
filters: |
|
|
scripts:
|
|
- 'scripts/**'
|
|
force-filters: |
|
|
- '.github/workflows/scripts.yml'
|
|
- 'package.json'
|
|
- 'pnpm-workspace.yaml'
|
|
- 'pnpm-lock.yaml'
|
|
|
|
scripts-unit-tests:
|
|
name: Test & Lint Scripts
|
|
needs: pre-job
|
|
if: ${{ fromJSON(needs.pre-job.outputs.should_run).scripts == true }}
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Setup Mise
|
|
uses: immich-app/devtools/actions/use-mise@06a9ef925332c91be647d6256642b86b398592c8 # use-mise-action-v3.2.1
|
|
with:
|
|
github_token: ${{ github.token }}
|
|
|
|
- name: Install dependencies
|
|
run: pnpm --filter @immich/scripts install --frozen-lockfile
|
|
|
|
- name: Run linter
|
|
run: pnpm --filter @immich/scripts lint
|
|
if: ${{ !cancelled() }}
|
|
|
|
- name: Run formatter
|
|
run: pnpm --filter @immich/scripts format
|
|
if: ${{ !cancelled() }}
|
|
|
|
- name: Run tsc
|
|
run: pnpm --filter @immich/scripts check
|
|
if: ${{ !cancelled() }}
|