Added gitlab ci

This commit is contained in:
2025-02-26 19:12:02 +01:00
parent 8f4ef928a0
commit a4b2114346
3 changed files with 83 additions and 4 deletions

73
.gitlab-ci.yml Normal file
View File

@@ -0,0 +1,73 @@
image: node:lts-alpine
stages:
- install
- lint
- test
- build
install:
stage: install
script:
- npm install --prefer-offline
cache:
key:
files:
- package.json
paths:
- node_modules
lint:
stage: lint
needs: ["install"]
script:
- npm run lint
cache:
key:
files:
- package.json
paths:
- node_modules
policy: pull
test:
stage: test
needs: ["install"]
before_script:
# Download Chrome
- apk add chromium
- export CHROME_BIN=/usr/bin/chromium-browser
- export CHROME_PATH=/usr/lib/chromium/
# Download Firefox
- apk add firefox-esr
- export FIREFOX_BIN=/usr/bin/firefox
- export FIREFOX_PATH=/usr/lib/firefox/
# X Server
- apk add xvfb
- export DISPLAY=:99
- Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
script:
- npm run test -- --browsers=Headless_Chrome --no-watch
cache:
key:
files:
- package.json
paths:
- node_modules
policy: pull
build:
stage: build
needs: ["test", "lint"]
script:
- npm run build
artifacts:
paths:
- $CI_PROJECT_DIR/dist
cache:
key:
files:
- package.json
paths:
- node_modules
policy: pull

View File

@@ -37,8 +37,14 @@ module.exports = function (config) {
colors: true, colors: true,
logLevel: config.LOG_INFO, logLevel: config.LOG_INFO,
autoWatch: true, autoWatch: true,
browsers: ['Chrome'],
singleRun: false, singleRun: false,
restartOnFileChange: true restartOnFileChange: true,
browsers: ["Chrome"],
customLaunchers: {
Headless_Chrome: {
base: "Chrome",
flags: ["--no-sandbox", "--disable-gpu"],
},
}
}); });
}; };

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{ {
"name": "WorkTime", "name": "WorkTime",
"version": "0.1.3", "version": "0.3.6",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "WorkTime", "name": "WorkTime",
"version": "0.1.3", "version": "0.3.6",
"dependencies": { "dependencies": {
"@angular/animations": "^18.0.0", "@angular/animations": "^18.0.0",
"@angular/common": "^18.0.0", "@angular/common": "^18.0.0",