diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 000000000..23267a4da --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,44 @@ +name: vprofile action +on: workflow_dispatch +env: + AWS_REGION: us-east-1 + ECR_REPOSITORY: vprofileapp + EKS_CLUSTER: vprofile-eks + +jobs: + Testing: + runs-on: ubuntu-latest + steps: + - name: Code checkout + uses: actions/checkout@v4 + + - name: Maven test + run: mvn test + + - name: checkstyle + run: mvn checkstyle:checkstyle + + - name: Set Java 11 + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'temurin' + + #run sonar scanner + - name: Run SonarQube Scanner + run: | + mvn sonar:sonar \ + -Dsonar.host.url=${{ secrets.SONAR_URL }} \ + -Dsonar.login=${{ secrets.SONAR_TOKEN }} \ + -Dsonar.organization=${{ secrets.SONAR_ORGANIZATION }} \ + -Dsonar.projectKey=${{ secrets.SONAR_PROJECT_KEY }} + + #check the quality gate status + - name: SonarQube Quality Gate Check + id: sonarqube-quality-gate-check + uses: sonarsource/sonarqube-quality-gate-action@master + timeout-minutes: 5 + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + SONAR_HOST_URL: ${{ secrets.SONAR_URL }} +