Build on branch bugfix/MARP-1012-Market-Server-Too-many-sonnar-images-after-scanning-code triggered by ntqdinh-axonivy #481
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: UI CI Build | |
run-name: Build on branch ${{github.ref_name}} triggered by ${{github.actor}} | |
on: | |
push: | |
paths: | |
- 'marketplace-ui/**' | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Build | |
runs-on: self-hosted | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
cache: 'npm' | |
cache-dependency-path: ./marketplace-ui/package-lock.json | |
- name: Install Dependencies | |
run: | | |
cd ./marketplace-ui | |
npm install | |
- name: Build project | |
run: | | |
cd ./marketplace-ui | |
npm run build | |
analysis: | |
name: Sonarqube | |
needs: build | |
runs-on: self-hosted | |
env: | |
SONAR_PROJECT_KEY: 'AxonIvy-Market-UI' | |
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
steps: | |
- name: Check if Chrome is already set up | |
id: check-chrome | |
run: | | |
if [ -f "/tmp/chrome-setup-done" ]; then | |
echo "Chrome is already set up." | |
echo "CHROME_SETUP=true" >> $GITHUB_ENV | |
else | |
echo "CHROME_SETUP=false" >> $GITHUB_ENV | |
fi | |
# Setp if there is no instance existed | |
- name: Setup Chrome | |
if: env.CHROME_SETUP == 'false' | |
uses: browser-actions/setup-chrome@v1 | |
# Use current Chrome instance from the last run | |
- name: Mark Chrome setup as done | |
if: env.CHROME_SETUP == 'false' | |
run: touch /tmp/chrome-setup-done | |
- name: Execute Tests | |
run: | | |
cd ./marketplace-ui | |
npm run test | |
- uses: sonarsource/sonarqube-scan-action@master | |
env: | |
SONAR_TOKEN: ${{ env.SONAR_TOKEN }} | |
SONAR_HOST_URL: ${{ env.SONAR_HOST_URL }} | |
with: | |
projectBaseDir: ./marketplace-ui | |
args: | |
-Dsonar.projectKey=${{ env.SONAR_PROJECT_KEY }} | |
-Dsonar.javascript.lcov.reportPaths=${{ github.workspace }}/marketplace-ui/coverage/lcov.info | |
- name: SonarQube Quality Gate check | |
id: sonarqube-quality-gate-check | |
uses: sonarsource/sonarqube-quality-gate-action@master | |
with: | |
scanMetadataReportFile: ${{ github.workspace }}/marketplace-ui/.scannerwork/report-task.txt | |
timeout-minutes: 5 | |
env: | |
SONAR_TOKEN: ${{ env.SONAR_TOKEN }} | |
SONAR_HOST_URL: ${{ env.SONAR_HOST_URL }} |