Add scan and test jobs
This commit is contained in:
@@ -8,8 +8,40 @@ on:
|
||||
- 'frontend-deployment.yaml'
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v4
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
- name: Install dependencies and test API
|
||||
working-directory: ./api
|
||||
run: npm install && node -c server.js
|
||||
- name: Install dependencies and test Frontend
|
||||
working-directory: ./frontend
|
||||
run: npm install
|
||||
|
||||
scan:
|
||||
runs-on: ubuntu-latest
|
||||
needs: test
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: SonarQube Scan
|
||||
uses: sonarsource/sonarqube-scan-action@master
|
||||
continue-on-error: true
|
||||
env:
|
||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
|
||||
|
||||
build-push-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
needs: scan
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
Reference in New Issue
Block a user