Add unite test

This commit is contained in:
2024-10-11 15:06:31 +02:00
parent c963758a06
commit 2d488a75eb
13 changed files with 1847 additions and 39 deletions

View File

@@ -1,4 +1,4 @@
name: Test build for dependabot
name: Deploy to server
on:
push:
@@ -7,9 +7,9 @@ on:
- master
jobs:
build-test:
build-and-deploy:
runs-on: ubuntu-latest
environment: test
environment: production
steps:
- name: Checkout code
@@ -22,11 +22,20 @@ jobs:
with:
node-version: '18'
- name: Install dependencies
- name: Install dependencies and build
run: |
npm ci
- name: Run build for production
run: |
npm run build
- name: Install http-server
run: npm install --save-dev http-server
- name: Start HTTP server
run: npx http-server ./dist -p 8080 &
env:
CI: true
- name: Run Cypress tests
run: npm run test
env:
CYPRESS_baseUrl: http://localhost:8080

View File

@@ -27,6 +27,19 @@ jobs:
npm ci
npm run build
- name: Install http-server
run: npm install --save-dev http-server
- name: Start HTTP server
run: npx http-server ./dist -p 8080 &
env:
CI: true
- name: Run Cypress tests
run: npm run test
env:
CYPRESS_baseUrl: http://localhost:8080
- name: Copy build directory to server
uses: Dylan700/sftp-upload-action@v1.2.3
with: