mirror of
https://github.com/Kevsl/crypto-exchange-api.git
synced 2025-07-09 14:00:12 +02:00
added sonar
This commit is contained in:
parent
278035a920
commit
49d24515a3
49
.github/workflows/ci.yml
vendored
49
.github/workflows/ci.yml
vendored
@ -3,16 +3,53 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [opened, synchronize, reopened]
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
sonarcloud:
|
# Nous appelons cette liste de tâches backend-test, car le sujet de cette ci est de réaliser des tests avant l'intégration sur main
|
||||||
name: SonarCloud
|
backend-test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
working-directory: .
|
||||||
|
steps:
|
||||||
|
# Nous allons utiliser l'action checkout qui récupère le code source depuis GitHub .
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
# Nous utilisons ensuite l'action setup-node@v4 avec la bonne version
|
||||||
|
# et npm.
|
||||||
|
- name: Set up Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: '20.17.0'
|
||||||
|
|
||||||
|
# Installation des dépendances avec npm install
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm install
|
||||||
|
|
||||||
|
# Execution des tests unitaires avec npm run test
|
||||||
|
- name: Run tests
|
||||||
|
run: npm run test
|
||||||
|
services:
|
||||||
|
postgres:
|
||||||
|
image: postgres:13
|
||||||
|
ports:
|
||||||
|
- 5432:5432
|
||||||
|
env:
|
||||||
|
POSTGRES_USER: postgres
|
||||||
|
POSTGRES_PASSWORD: ${{ secrets.CI_DB_PASSWORD }}
|
||||||
|
POSTGRES_DB: testdb
|
||||||
|
|
||||||
|
sonarqube:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: SonarCloud Scan
|
- name: SonarQube Scan
|
||||||
uses: SonarSource/sonarcloud-github-action@master
|
uses: sonarsource/sonarqube-scan-action@<action version>
|
||||||
env:
|
env:
|
||||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||||
|
SONAR_HOST_URL: ${{ vars.SONAR_HOST_URL }}
|
Loading…
x
Reference in New Issue
Block a user