Skip to content

👷 cypress end-to-end testing #637

👷 cypress end-to-end testing

👷 cypress end-to-end testing #637

Workflow file for this run

name: Checks
on:
pull_request:
branches: [main]
push:
branches: [main]
workflow_dispatch:
concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.branch }}
jobs:
build:
name: Build client
runs-on: ubuntu-latest
steps:
- uses: haliphax/narf/.github@main
- name: Build client
run: npm run build
commitlint:
name: CommitLint
if: ${{ contains(github.event_name, 'pull_request') }}
runs-on: ubuntu-latest
steps:
- uses: haliphax/narf/.github@main
- name: Lint pull request title
env:
PR_TITLE: ${{ github.event.pull_request.title }}
run: echo "$PR_TITLE" | npx commitlint
e2e:
name: End-to-end tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Docker build
run: docker build -t narf:latest .
- name: Cypress
run: |
mkdir db
npm i cypress
docker run -d -p 3000:3000 -v $(pwd)/db:/app/db narf:latest
npm run e2e
eslint:
runs-on: ubuntu-latest
steps:
- uses: haliphax/narf/.github@main
- name: ESLint
run: npx eslint .
prettier:
runs-on: ubuntu-latest
steps:
- uses: haliphax/narf/.github@main
- name: Prettier
run: npx prettier -l -u .
unit-tests:
name: Unit tests
runs-on: ubuntu-latest
steps:
- uses: haliphax/narf/.github@main
- uses: testspace-com/setup-testspace@v1
with:
domain: ${{ github.repository_owner }}
- name: Run unit tests
run: npm run coverage
- name: Upload coverage report or add comment
uses: coverallsapp/github-action@v2
if: always()
with:
file: coverage/clover.xml
- name: Push result to Testspace server
run: testspace ./coverage/clover.xml ./coverage/junit.xml
if: always()