feat: Add basic full tests with actions

Signed-off-by: Florian BOUILLON <f.bouillon@aptatio.com>
This commit is contained in:
Florian Bouillon 2023-07-04 15:32:35 +02:00
parent cd5993c04c
commit 3669078563
5 changed files with 60 additions and 2 deletions

View File

@ -7,3 +7,8 @@ charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 120
# Yaml Standard
[*.{yaml,yml}]
indent_style = space
indent_size = 2

47
.github/workflows/build_and_check.yml vendored Normal file
View File

@ -0,0 +1,47 @@
name: Build, check & Test
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
install:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use Node.js 20.x
uses: actions/setup-node@v3
with:
node-version: 20.x
- name: Install dependencies
run: npm ci
build:
- name: Build
run: npm run build
check:
needs: 'install'
steps:
- name: Check
run: |
npm run start &
wait 10
npm run check
test:
needs: 'build'
steps:
- name: Test
run : |
npm run start &
sleep 10
npm run test

View File

@ -37,6 +37,7 @@ FROM node:20-slim as PROD_IMAGE
# inform software to be in production
ENV NODE_ENV=production
ENV HOST=0.0.0.0
ENV ASTRO_TELEMETRY_DISABLED=true
# Download & Install Slic3r
# RUN apt-get update \

1
cypress/.gitignore vendored
View File

@ -1 +1,2 @@
videos
screenshots

View File

@ -7,9 +7,13 @@
"dev": "astro dev",
"start": "node ./dist/server/entry.mjs",
"build": "astro build",
"preview": "astro preview",
"astro": "astro",
"test": "vitest --coverage"
"check": "npm run check:astro && npm run check:typescript",
"check:astro": "astro check",
"check:typescript": "tsc --noEmit",
"test": "npm run test:unit && npm run test:integ",
"test:unit": "vitest --coverage",
"test:integ": "cypress run"
},
"dependencies": {
"@astrojs/node": "^5",