From 7e4fee5a05ac162a751ead852260df6395145d24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beatrice=20Dellac=C3=A0?= Date: Sun, 9 Mar 2025 01:14:22 +0100 Subject: [PATCH] implement drone --- .drone.yml | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..3aa2863 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,48 @@ +kind: pipeline +type: docker +name: build +platform: + os: linux + arch: arm64 + +trigger: + branch: + - main + event: + - push + - pull_request + +steps: + # Install project dependencies + - name: install + image: node:20-alpine + commands: + - npm ci + + # Build the Angular project + - name: build + image: node:18-alpine + commands: + - npm run build --if-present + + # Run unit tests (e.g. using Karma, Jest or your configured test runner) + - name: test + image: node:18-alpine + commands: + - npm test + + # Run SonarQube code analysis + - name: code-analysis + image: node:18-alpine + commands: + # Install sonar-scanner globally + - npm install -g sonar-scanner + # Run sonar-scanner with your parameters + - sonar-scanner -Dsonar.projectKey=$SONAR_PROJECT_KEY -Dsonar.sources=. -Dsonar.host.url=$SONAR_INSTANCE_URL -Dsonar.login=$SONAR_LOGIN_KEY + environment: + SONAR_PROJECT_KEY: + from_secret: sonar_project_key + SONAR_INSTANCE_URL: + from_secret: sonar_instance_url + SONAR_LOGIN_KEY: + from_secret: sonar_login_key