Skip to content

Commit

Permalink
Merge pull request #9306 from princegupta1131/8.0.0_github_action
Browse files Browse the repository at this point in the history
8.0.0 GitHub action
  • Loading branch information
rajeevsathish authored Jun 13, 2024
2 parents 736e2c3 + b8edf9e commit 44eaad3
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 22 deletions.
40 changes: 20 additions & 20 deletions .github/workflows/ci-cd.yml → .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI/CD
name: Build

on:
push:
Expand All @@ -7,6 +7,8 @@ on:
pull_request:
branches:
- "*" # Trigger on pull request to any branch
workflow_dispatch: # Manual trigger
pull_request_target: # This is to access secrets from forked PRs

jobs:
build-and-test:
Expand Down Expand Up @@ -78,27 +80,25 @@ jobs:
# yarn install
# npm run test:ci
# Debug: Print the masked SONAR_TOKEN
- name: Print SONAR_TOKEN
run: echo "SONAR_TOKEN=${{ secrets.SONAR_TOKEN }}PWR****123"
# - name: Print SONAR_TOKEN
# run: echo "SONAR_TOKEN=${{ secrets.SONAR_TOKEN }}PWR****123"

#Install Sonar Scanner
- name: Install Sonar Scanner
run: |
cd /tmp
wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-5.0.1.3006-linux.zip
sudo apt-get install -y unzip
unzip sonar-scanner-cli-5.0.1.3006-linux.zip
cd -
# #Install Sonar Scanner
# - name: Install Sonar Scanner
# run: |
# cd /tmp
# wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-5.0.1.3006-linux.zip
# sudo apt-get install -y unzip
# unzip sonar-scanner-cli-5.0.1.3006-linux.zip
# cd -

# Run SonarScanner for frontend (Angular)
- name: Run SonarScanner for frontend
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
/tmp/sonar-scanner-5.0.1.3006-linux/bin/sonar-scanner \
-Dsonar.sources=src/app/client/src \
-Dsonar.host.url=https://sonarcloud.io \
-Dsonar.login=$SONAR_TOKEN
# # Run SonarScanner for frontend (Angular)
# - name: Run SonarScanner for frontend
# env:
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# run: |
# /tmp/sonar-scanner-5.0.1.3006-linux/bin/sonar-scanner \
# -Dsonar.login=$SONAR_TOKEN

# - name: Run Sonar Scanner
# env:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and Deploy
name: Build and Upload Artifact

on:
push:
Expand All @@ -10,7 +10,7 @@ on:

jobs:
build_and_deploy:
name: Build and Deploy Job # Define the name of the job
name: Build and Upload Artifact Job # Define the name of the job
runs-on: ubuntu-latest

steps:
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Use the data

on:
workflow_run:
workflows: ["Build"]
types:
- completed

jobs:
download:
runs-on: ubuntu-latest
if: github.event.workflow_run.conclusion == 'success'
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Print SONAR_TOKEN
run: echo "SONAR_TOKEN=${{ secrets.SONAR_TOKEN }}PWR****123"

# Install Sonar Scanner
- name: Install Sonar Scanner
run: |
sudo apt-get update && sudo apt-get install -y unzip
wget -O /tmp/sonar-scanner-cli.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-5.0.1.3006-linux.zip
unzip /tmp/sonar-scanner-cli.zip -d /tmp
# Run SonarScanner for frontend (Angular)
- name: Run SonarScanner for frontend
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
/tmp/sonar-scanner-5.0.1.3006-linux/bin/sonar-scanner \
-Dsonar.login=$SONAR_TOKEN

0 comments on commit 44eaad3

Please sign in to comment.