Skip to content

Testing dependabot/npm_and_yarn/semver-6.3.1 🧪 #50

Testing dependabot/npm_and_yarn/semver-6.3.1 🧪

Testing dependabot/npm_and_yarn/semver-6.3.1 🧪 #50

Workflow file for this run

name: Tests & Lint
run-name: Testing ${{ github.head_ref }} 🧪
on:
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
workflow_dispatch:
env:
DB_USER: postgres
DB_PASSWORD: secret
DB_PORT: 5432
API_ROUTES_PREFIX: api
TEST_DB_HOST: localhost
TEST_DB_NAME: test_db
jobs:
type-check-lint-and-build:
name: Type-check, lint & build
runs-on: ubuntu-latest
steps:
- name: Checkout repository code
uses: actions/checkout@v3
- name: Setup node version
uses: actions/setup-node@v3
with:
node-version-file: '.node-version'
cache: 'yarn'
- name: Cache node modules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Type check
run: yarn type-check
- name: Lint
run: yarn lint
- name: Build app
run: yarn build
e2e-tests:
name: E2E tests
runs-on: ubuntu-latest
services:
postgres:
image: postgres:15-alpine
env:
POSTGRES_PORT: ${{ env.DB_PORT }}
POSTGRES_DB: ${{ env.TEST_DB_NAME }}
POSTGRES_USER: ${{ env.DB_USER }}
POSTGRES_PASSWORD: ${{ env.DB_PASSWORD }}
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout repository code
uses: actions/checkout@v3
- name: Setup node version
uses: actions/setup-node@v3
with:
node-version-file: '.node-version'
cache: 'yarn'
- name: Cache node modules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Run E2E tests
run: yarn test:coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}