Skip to content

Resetup E2E tests #1507

Resetup E2E tests

Resetup E2E tests #1507

Workflow file for this run

name: "Frontend: build, test & lint"
on:
push:
branches: main
paths:
- frontend/**
pull_request:
paths:
- frontend/**
jobs:
build:
name: Build, test & lint
runs-on: ubuntu-latest
defaults:
run:
working-directory: frontend
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version-file: ./frontend/.nvmrc
- name: Get NPM cache folder path
id: npm-cache-folder
run: |
echo "path=$(npm config get cache)" >> $GITHUB_OUTPUT
- name: Set up NPM cache
uses: actions/cache@v3
id: npm-cache
env:
cache-name: frontend-node-modules
with:
path: ${{ steps.npm-cache-folder.outputs.path }}
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-${{ env.cache-name }}-
- name: Install dependencies
run: |
npm ci
- name: Lint
run: |
npm run lint
- name: Check formatting
run: |
npx prettier --check .
- name: Build
run: |
npm run build
- name: Run unit tests
run: |
npm run test:unit
- name: Spin up database
run: |
# docker compose up cockroach -d
docker run -d --name cockroach \
-e COCKROACH_USER=volebnikalkulacka \
-e COCKROACH_PASSWORD=volebnikalkulacka \
-e COCKROACH_DATABASE=volebnikalkulacka \
-p 26257:26257 \
-p 8080:8080 \
cockroachdb/cockroach \
start-single-node
sudo apt update && sudo apt install wait-for-it -y
wait-for-it -h localhost -p 26257
- name: Run end-to-end tests
run: |
npm run test:e2e:ci