Skip to content

GAP-2543-opening-closing-times #398

GAP-2543-opening-closing-times

GAP-2543-opening-closing-times #398

Workflow file for this run

name: Feature Workflow
on:
pull_request:
branches:
- develop
paths-ignore:
- '*.md'
env:
DATABASE_URL: postgres://postgres:mysecretpassword@localhost:5432/notifications
jobs:
Build:
name: Test app
runs-on: ubuntu-latest
permissions:
contents: read
steps:
# ==============================
- name: Dump context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "${GITHUB_CONTEXT}"
# ==============================
- name: Checkout repo
uses: actions/checkout@v4
- name: Generate source files hash
id: source-file-hash
run: |
NAME=${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
echo "name=$NAME" >> $GITHUB_OUTPUT
- name: Generate yarn lock hash
id: yarn-lock-hash
run: |
NAME=${{ hashFiles('**/yarn.lock') }}
echo "name=$NAME" >> $GITHUB_OUTPUT
- name: Generate .env files
run: cp .env.example .env
- name: Read .nvmrc
run: echo "name=NVMRC::$(cat .nvmrc)" >> $GITHUB_OUTPUT
id: nvm
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'
cache: 'yarn'
- name: Install dependencies
run: yarn install --immutable
# Based on steps described here - https://nextjs.org/docs/pages/building-your-application/deploying/ci-build-caching#github-actions
- name: Next cache
uses: actions/cache@v3
with:
path: ${{ github.workspace }}/.next/cache
key: next-cache-${{ steps.yarn-lock-hash.outputs.name }}-${{ steps.source-file-hash.outputs.name }}
restore-keys: next-cache-${{ steps.yarn-lock-hash.outputs.name }}-
- name: Build application
run: yarn build
- name: Units Tests
run: yarn jest --ci
- name: Lint files
run: yarn lint