Skip to content

fix: various SEO & UX fixes #1460

fix: various SEO & UX fixes

fix: various SEO & UX fixes #1460

Workflow file for this run

# This workflow will do a clean install of node dependencies, build the source code and run tests
name: 'Pre-merge checks'
on:
pull_request:
branches: [main]
# Be extremely careful as the env variables defined here are accessible by all the actions of the workflow.
# For critical env variable, declare it within the action.
env:
node-version: 18.x
INSEE_CLIENT_ID: ${{ secrets.INSEE_CLIENT_ID }}
INSEE_CLIENT_SECRET: ${{ secrets.INSEE_CLIENT_SECRET}}
INSEE_CLIENT_ID_FALLBACK: ${{ secrets.INSEE_CLIENT_ID_FALLBACK }}
INSEE_CLIENT_SECRET_FALLBACK: ${{ secrets.INSEE_CLIENT_SECRET_FALLBACK}}
INSEE_ENABLED: enabled
INDEXING_ENABLED: enabled
REDIS_ENABLED: disabled
PROXY_API_KEY: ${{ secrets.PROXY_API_KEY }}
MONCOMPTEPRO_CLIENT_ID: ${{ secrets.MONCOMPTEPRO_CLIENT_ID }}
MONCOMPTEPRO_CLIENT_SECRET: ${{ secrets.MONCOMPTEPRO_CLIENT_SECRET }}
MONCOMPTEPRO_URL: ${{ secrets.MONCOMPTEPRO_URL }}
MONCOMPTEPRO_REDIRECT_URI: ${{ secrets.MONCOMPTEPRO_REDIRECT_URI }}
MONCOMPTEPRO_POST_LOGOUT_REDIRECT_URI: ${{ secrets.MONCOMPTEPRO_POST_LOGOUT_REDIRECT_URI }}
IRON_SESSION_PWD: ${{ secrets.IRON_SESSION_PWD }}
GRIST_API_KEY: ${{ secrets.GRIST_API_KEY }}
UPDOWN_IO_API_KEY: ${{ secrets.UPDOWN_IO_API_KEY }}
jobs:
dependencies:
name: 'Install dependencies'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ env.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.node-version }}
- uses: ./.github/actions/install-dependencies
name: Install and cache dependencies
lint:
name: Lint
runs-on: ubuntu-latest
needs: [dependencies]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ env.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.node-version }}
- name: Load node_modules
uses: ./.github/actions/load-dependencies
- name: Run linter
run: npm run lint
build:
name: Build
runs-on: ubuntu-latest
needs: [dependencies]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ env.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.node-version }}
- name: Load node_modules
uses: ./.github/actions/load-dependencies
- name: Build site
run: npm run build
- name: Cache site
uses: actions/cache@v3
id: restore-build
with:
path: ./*
key: ${{ github.sha }}
tests:
name: Unit tests
runs-on: ubuntu-latest
needs: [dependencies]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ env.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.node-version }}
- name: Load node_modules
uses: ./.github/actions/load-dependencies
- name: Run unit tests
run: |
npm run test:unit
testE2E:
name: End2end tests
runs-on: ubuntu-latest
needs: [dependencies]
env:
NEXT_PUBLIC_END2END_MOCKING: enabled
steps:
- name: Checkout 🛎
uses: actions/checkout@v3
- name: Use Node.js ${{ env.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.node-version }}
- name: Load node_modules
uses: ./.github/actions/load-dependencies
- name: Build site with E2E mocking
run: npm run build
env:
NEXT_PUBLIC_END2END_MOCKING: enabled
- name: Run Cypress tests 🧪
# https://github.com/cypress-io/github-action
uses: cypress-io/github-action@v5
timeout-minutes: 10
with:
start: npm start
record: false
env:
PORT: 3000
NEXT_PUBLIC_END2END_MOCKING: enabled
typecheck:
name: Type check
runs-on: ubuntu-latest
needs: [dependencies]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ env.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.node-version }}
- name: Load node_modules
uses: ./.github/actions/load-dependencies
- name: Run typescript check
run: npx tsc --noEmit