Skip to content

app-nextjs: Update template-application-nextjs to version 0.1.0.pos… #64

app-nextjs: Update template-application-nextjs to version 0.1.0.pos…

app-nextjs: Update template-application-nextjs to version 0.1.0.pos… #64

Workflow file for this run

name: CI - app-nextjs
on:
push:
branches:
- main
pull_request:
paths:
- app-nextjs/**
- .github/workflows/ci-app-nextjs.yml
defaults:
run:
working-directory: ./app-nextjs
env:
NODE_VERSION_FILE: ./app-nextjs/package.json
LOCKFILE_PATH: ./app-nextjs/package-lock.json # or yarn.lock
PACKAGE_MANAGER: npm # or yarn
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
tests:
name: Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: ${{ env.NODE_VERSION_FILE }}
cache-dependency-path: ${{ env.LOCKFILE_PATH }}
cache: ${{ env.PACKAGE_MANAGER }}
- run: npm ci
- run: npm run test -- --testLocationInResults --json --outputFile=coverage/report.json
- uses: ArtiomTr/jest-coverage-report-action@v2
with:
coverage-file: coverage/report.json
test-script: npm test
working-directory: app-nextjs
annotations: failed-tests
# base-coverage-file: report.json
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: ${{ env.NODE_VERSION_FILE }}
cache-dependency-path: ${{ env.LOCKFILE_PATH }}
cache: ${{ env.PACKAGE_MANAGER }}
- run: npm ci
- run: npm run lint
types:
name: Type check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: ${{ env.NODE_VERSION_FILE }}
cache-dependency-path: ${{ env.LOCKFILE_PATH }}
cache: ${{ env.PACKAGE_MANAGER }}
- run: npm ci
- run: npm run ts:check
formatting:
name: Format check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: ${{ env.NODE_VERSION_FILE }}
cache-dependency-path: ${{ env.LOCKFILE_PATH }}
cache: ${{ env.PACKAGE_MANAGER }}
- run: npm ci
- run: npm run format-check
# Confirms the app still builds successfully
check-app-builds:
name: Build check - App
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: ${{ env.NODE_VERSION_FILE }}
cache-dependency-path: ${{ env.LOCKFILE_PATH }}
cache: ${{ env.PACKAGE_MANAGER }}
# https://nextjs.org/docs/advanced-features/ci-build-caching
- uses: actions/cache@v4
with:
path: |
~/.npm
${{ github.workspace }}/app-nextjs/.next/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-
- run: npm ci
- run: npm run build -- --no-lint
# Confirms Storybook still builds successfully
check-storybook-builds:
name: Build check - Storybook
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: ${{ env.NODE_VERSION_FILE }}
cache-dependency-path: ${{ env.LOCKFILE_PATH }}
cache: ${{ env.PACKAGE_MANAGER }}
- run: npm ci
- run: npm run storybook-build