jan/.github/workflows/quality-gate.yml
hiento09 a251a32528
Add CI for Jan-cloud (#69)
* Add CI staging for Jan-cloud

* Update web-client/Dockerfile

switch from npm to yarn command

Co-authored-by: Louis <133622055+louis-jan@users.noreply.github.com>

* Update web-client/Dockerfile

Correct yarn build command

Co-authored-by: Louis <133622055+louis-jan@users.noreply.github.com>

---------

Co-authored-by: Hien To <tominhhien97@gmail.com>
Co-authored-by: Louis <133622055+louis-jan@users.noreply.github.com>
2023-09-07 10:21:06 +07:00

40 lines
1.2 KiB
YAML

name: Linter & Sonarqube scanner
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test-lint:
runs-on: ubuntu-latest
steps:
- name: Getting the repo
uses: actions/checkout@v2
- name: create sonar properties file
run: |
echo "Branch Name ${GITHUB_REF#refs/heads/}"
echo -e "sonar.sources = ." > sonar-project.properties
echo -e "sonar.projectKey = ${{ secrets.PROJECT_KEY }}" >> sonar-project.properties
if [[ "${{ github.event_name }}" == "push" ]]; then
echo -e "sonar.branch.name = ${GITHUB_REF#refs/heads/}" >> sonar-project.properties
fi
- name: SonarQube Scan
uses: sonarsource/sonarqube-scan-action@master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
# Check the Quality Gate status.
- name: SonarQube Quality Gate check
id: sonarqube-quality-gate-check
uses: sonarsource/sonarqube-quality-gate-action@master
# Force to fail step after specific time.
timeout-minutes: 5
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} #OPTIONAL