-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (54 loc) · 1.67 KB
/
sonarcloud-analysis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: SonarCloud-Analysis
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
jobs:
sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Configure React environment vars
env:
ENDPOINT_DOC_STORE_API: http://localhost:3000
AWS_REGION: test region
OIDC_PROVIDER_ID: not provided yet
BUILD_ENV: development
IMAGE_VERSION: 'ndr-${{ vars.BUILD_ENV }}-app:${{ github.sha }}'
run: |
./react-environment-config.sh
working-directory: ./app
shell: bash
- run: make clean-install
- run: make test-ui-coverage
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Make virtual environment
run: |
make env
- name: Start virtual environment
run: |
source ./lambdas/venv/bin/activate
# echo PATH=$PATH >> $GITHUB_ENV
- name: Test with pytest
run: |
make test-unit-coverage
cd ./lambdas
sed -i "s@filename=\"@filename=\"lambdas/@" coverage.xml
cd ..
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}