mirror of
https://github.com/immich-app/static-pages.git
synced 2026-09-30 13:23:05 +08:00
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
68 lines
1.6 KiB
YAML
68 lines
1.6 KiB
YAML
name: Test
|
|
on:
|
|
workflow_dispatch:
|
|
pull_request:
|
|
push:
|
|
branches: [main]
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
test:
|
|
name: Test
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
app_name: ['api', 'next', 'my', 'buy', 'get', 'datasets']
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
|
|
|
|
- name: Setup Node
|
|
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
|
|
with:
|
|
node-version-file: '.nvmrc'
|
|
|
|
- name: Set app
|
|
run: |
|
|
touch .env
|
|
echo IMMICH_APP="${{ matrix.app_name }}.immich.app" >> .env
|
|
|
|
- name: Run npm install
|
|
run: npm ci
|
|
|
|
- name: Run linter
|
|
run: npm run lint
|
|
if: ${{ !cancelled() }}
|
|
|
|
- name: Run formatter
|
|
run: npm run format
|
|
if: ${{ !cancelled() }}
|
|
|
|
- name: Run tsc
|
|
run: npm run check
|
|
if: ${{ !cancelled() }}
|
|
|
|
- name: Run unit tests
|
|
run: npm test
|
|
if: ${{ !cancelled() }}
|
|
|
|
- name: Check for app backend
|
|
id: check-backend
|
|
run: |
|
|
if [ -d "apps/${{ matrix.app_name }}.immich.app/backend" ]; then
|
|
echo "has_backend=true" >> $GITHUB_ENV
|
|
else
|
|
echo "has_backend=false" >> $GITHUB_ENV
|
|
fi
|
|
|
|
- name: Test backend
|
|
if: ${{ env.has_backend == 'true' }}
|
|
working-directory: 'apps/${{ matrix.app_name }}.immich.app/backend'
|
|
run: |
|
|
npm ci
|
|
npm test
|