Address node warnings in workflows (#335) #472
This file contains hidden or 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: CI Checks (Pull Request) | |
| on: | |
| push: | |
| workflow_dispatch: | |
| inputs: | |
| ref: | |
| description: 'Ref of ssas-app to checkout (tag, branch name, or full SHA)' | |
| required: true | |
| type: string | |
| jobs: | |
| go_mod_tidy: | |
| name: Modules Lint | |
| runs-on: codebuild-bcda-ssas-app-non-prod-${{github.run_id}}-${{github.run_attempt}} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.3.0 | |
| with: | |
| repository: CMSgov/bcda-ssas-app | |
| ref: ${{ inputs.ref }} | |
| - name: Get Go | |
| uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c #v6.4.0 | |
| with: | |
| go-version-file: 'go.mod' | |
| - name: Tidy modules | |
| run: | | |
| go mod tidy -v | |
| CHANGES_FOUND=$(git diff-files --quiet) | |
| if [[ "$(CHANGES_FOUND)" == "1" ]]; then | |
| echo "Changes found. Run go mod tidy to clean up modules." | |
| git diff | |
| exit 1 | |
| fi | |
| lint_and_test: | |
| name: Lint and Test | |
| runs-on: codebuild-bcda-ssas-app-non-prod-${{github.run_id}}-${{github.run_attempt}} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.3.0 | |
| with: | |
| repository: CMSgov/bcda-ssas-app | |
| ref: ${{ inputs.ref }} | |
| - name: Get Go | |
| uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c #v6.4.0 | |
| with: | |
| go-version-file: 'go.mod' | |
| - name: Build the stack | |
| run: make docker-bootstrap | |
| - name: Lint and Test | |
| run: make test | |
| - name: Archive code coverage results | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: code-coverage-report-ssas | |
| path: ./test_results/latest/testcoverage-ssas.out | |
| sonar-quality-gate: | |
| name: Sonarqube Quality Gate | |
| needs: lint_and_test | |
| runs-on: codebuild-bcda-ssas-app-non-prod-${{github.run_id}}-${{github.run_attempt}} | |
| steps: | |
| - name: Set env vars from AWS params | |
| uses: cmsgov/cdap/actions/aws-params-env-action@main | |
| env: | |
| AWS_REGION: ${{ vars.AWS_REGION }} | |
| with: | |
| params: | | |
| SONAR_HOST_URL=/sonarqube/url | |
| SONAR_TOKEN=/sonarqube/token | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.3.0 | |
| with: | |
| repository: CMSgov/bcda-ssas-app | |
| fetch-depth: 0 | |
| - name: Download code coverage | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | |
| with: | |
| name: code-coverage-report-ssas | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v7 | |
| with: | |
| node-version: 24 | |
| - name: Run quality gate scan | |
| uses: sonarsource/sonarqube-scan-action@299e4b793aaa83bf2aba7c9c14bedbb485688ec4 | |
| with: | |
| args: | |
| -Dsonar.scanner.arch=aarch64 | |
| -Dsonar.projectKey=bcda-ssas-api | |
| -Dsonar.sources=. | |
| -Dsonar.working.directory=./sonar_workspace | |
| -Dsonar.go.coverage.reportPaths=./testcoverage-ssas.out | |
| -Dsonar.coverage.exclusions=**/*test.go,**/test/**/*,**/testUtils/*,**/scripts/*,**/ops/*,**/mock*.go,**/mock/**/*,**/*_mock.go,**/testutils.go | |
| -Dsonar.branch.name=${{ inputs.ref }} | |
| -Dsonar.projectVersion=${{ github.sha }} | |
| -Dsonar.qualitygate.wait=true | |
| -Dsonar.ci.autoconfig.disabled=true |