Skip to content

feature: Consent Form #55

feature: Consent Form

feature: Consent Form #55

Workflow file for this run

name: Node.js CI
on: pull_request
jobs:
lint-code:
runs-on: ubuntu-latest
timeout-minutes: 10
env:
DATOCMS_READONLY_API_TOKEN: ${{ secrets.DATOCMS_READONLY_API_TOKEN }}
DATOCMS_API_TOKEN: '' # required but unused in this workflow
HEAD_START_PREVIEW_SECRET: '' # required but unused in this workflow
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
- name: Use dependencies cache
uses: actions/cache@v3
with:
path: ~/.npm
key: npm-${{ hashFiles('package-lock.json') }}
restore-keys: npm-
- name: Install dependencies
run: npm ci --ignore-scripts --no-audit --no-fund
- name: Prepare setup
run: npm run prep
# eslint is fast, run it first to fail fast
- name: Lint all code files
run: npm run lint:eslint -- --max-warnings 0
# astro check finds more errors, but is slower, so run it last
- name: Lint Astro files
run: npm run lint:astro -- --minimumSeverity warning
validate-html:
runs-on: ubuntu-latest
timeout-minutes: 10
env:
DATOCMS_READONLY_API_TOKEN: ${{ secrets.DATOCMS_READONLY_API_TOKEN }}
DATOCMS_API_TOKEN: '' # required but unused in this workflow
HEAD_START_PREVIEW_SECRET: '' # required but unused in this workflow
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
- name: Use dependencies cache
uses: actions/cache@v3
with:
path: ~/.npm
key: npm-${{ hashFiles('package-lock.json') }}
restore-keys: npm-
- name: Install dependencies
run: npm ci --ignore-scripts --no-audit --no-fund
- name: Create production build
run: npm run build
- name: Validate HTML
run: npm run lint:html