From 657f80af5d40936deef1af470f98c5064feb35fd Mon Sep 17 00:00:00 2001 From: Naomi Carrigan Date: Wed, 26 Feb 2025 12:52:56 -0800 Subject: [PATCH] feat: separate workflow files --- .gitea/workflows/ci.yml | 19 ------------------- .gitea/workflows/sonar-main.yml | 24 ++++++++++++++++++++++++ .gitea/workflows/sonar-pr.yml | 29 +++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+), 19 deletions(-) create mode 100644 .gitea/workflows/sonar-main.yml create mode 100644 .gitea/workflows/sonar-pr.yml diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 71d482c..66204d9 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -30,22 +30,3 @@ jobs: - name: Run Tests run: pnpm run test - - - name: Echo - run: | - echo "PR Number: ${{ github.event.pull_request.number }}" - echo "PR Branch: ${{ github.event.pull_request.head.ref }}" - - - name: Sonar - uses: SonarSource/sonarqube-scan-action@v4 - timeout-minutes: 10 - env: - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - SONAR_HOST_URL: "https://quality.nhcarrigan.com" - with: - args: > - -Dsonar.sources=. - -Dsonar.projectKey=typescript-config - -Dsonar.pullrequest.key=${{ github.event.pull_request.number }} - -Dsonar.pullrequest.branch=${{ github.event.pull_request.head.ref }} - -Dsonar.pullrequest.base=main diff --git a/.gitea/workflows/sonar-main.yml b/.gitea/workflows/sonar-main.yml new file mode 100644 index 0000000..33278b3 --- /dev/null +++ b/.gitea/workflows/sonar-main.yml @@ -0,0 +1,24 @@ +name: Code Analysis +on: + push: + branches: + - main + +jobs: + sonar: + name: SonarQube + + steps: + - name: Checkout Source Files + uses: actions/checkout@v4 + + - name: Sonar + uses: SonarSource/sonarqube-scan-action@v4 + timeout-minutes: 10 + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + SONAR_HOST_URL: "https://quality.nhcarrigan.com" + with: + args: > + -Dsonar.sources=. + -Dsonar.projectKey=typescript-config diff --git a/.gitea/workflows/sonar-pr.yml b/.gitea/workflows/sonar-pr.yml new file mode 100644 index 0000000..235dc6a --- /dev/null +++ b/.gitea/workflows/sonar-pr.yml @@ -0,0 +1,29 @@ +name: Code Analysis +on: + pull_request: + branches: + - main + +jobs: + sonar: + name: SonarQube + + steps: + - name: Checkout Source Files + uses: actions/checkout@v4 + + - name: Sonar + uses: SonarSource/sonarqube-scan-action@v4 + timeout-minutes: 10 + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + SONAR_HOST_URL: "https://quality.nhcarrigan.com" + PR_KEY: ${{ github.event.pull_request.number }} + PR_BRANCH: ${{ github.event.pull_request.head.ref }} + with: + args: > + -Dsonar.sources=. + -Dsonar.projectKey=typescript-config + -Dsonar.pullrequest.key=$PR_KEY + -Dsonar.pullrequest.branch=$PR_BRANCH + -Dsonar.pullrequest.base=main