From 4cb4097934efe7454952b0df052e55b215f21d86 Mon Sep 17 00:00:00 2001 From: Matias <83959431+mativm02@users.noreply.github.com> Date: Wed, 2 Oct 2024 09:14:42 -0300 Subject: [PATCH 1/2] Upgrading upload-artifact to v3 --- .github/workflows/ci-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml index 38b897dc..2e5be0cc 100644 --- a/.github/workflows/ci-tests.yml +++ b/.github/workflows/ci-tests.yml @@ -32,7 +32,7 @@ jobs: with: version: latest args: --out-format=checkstyle:golanglint.xml --timeout=600s --max-issues-per-linter=0 --max-same-issues=0 --new-from-rev=origin/${{ github.base_ref }} - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 with: name: golangcilint retention-days: 1 @@ -80,7 +80,7 @@ jobs: - name: Run tests run: | ./bin/ci-tests.sh ${{ matrix.databases }} - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 with: name: coverage retention-days: 1 From 9d1eaa5baae5b98e951e873854d39422734ed30f Mon Sep 17 00:00:00 2001 From: Matias <83959431+mativm02@users.noreply.github.com> Date: Wed, 2 Oct 2024 09:30:47 -0300 Subject: [PATCH 2/2] Upgrading download-artifact to v3 --- .github/workflows/ci-tests.yml | 102 ++++++++++++++++----------------- 1 file changed, 51 insertions(+), 51 deletions(-) diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml index 2e5be0cc..247fe19d 100644 --- a/.github/workflows/ci-tests.yml +++ b/.github/workflows/ci-tests.yml @@ -11,10 +11,10 @@ on: - release-** env: TYK_IB_STORAGE_STORAGETYPE: file - + permissions: contents: read - + jobs: golangci-lint: runs-on: ubuntu-latest @@ -38,9 +38,9 @@ jobs: retention-days: 1 path: | golanglint.xml - + ci-test: - name: '${{ matrix.databases }}' + name: "${{ matrix.databases }}" runs-on: ubuntu-latest strategy: fail-fast: false @@ -52,41 +52,41 @@ jobs: redis-version: [5] mongodb-version: [4.2] steps: - - name: Checkout Code - uses: actions/checkout@v4 - with: - fetch-depth: 2 - - - name: Setup Go - uses: actions/setup-go@v2 - with: - go-version: '^1.21' + - name: Checkout Code + uses: actions/checkout@v4 + with: + fetch-depth: 2 - - name: Install Dependencies and basic hygiene test - id: hygiene - run: | - go install golang.org/x/tools/cmd/goimports@latest - - - name: Start Redis - uses: supercharge/redis-github-action@1.2.0 - with: + - name: Setup Go + uses: actions/setup-go@v2 + with: + go-version: "^1.21" + + - name: Install Dependencies and basic hygiene test + id: hygiene + run: | + go install golang.org/x/tools/cmd/goimports@latest + + - name: Start Redis + uses: supercharge/redis-github-action@1.2.0 + with: redis-version: ${{ matrix.redis-version }} - - name: Start MongoDB - uses: supercharge/mongodb-github-action@1.2.0 - with: - mongodb-version: '${{ matrix.mongodb-version }}' - - - name: Run tests - run: | - ./bin/ci-tests.sh ${{ matrix.databases }} - - uses: actions/upload-artifact@v3 - with: - name: coverage - retention-days: 1 - path: | - *cov - + - name: Start MongoDB + uses: supercharge/mongodb-github-action@1.2.0 + with: + mongodb-version: "${{ matrix.mongodb-version }}" + + - name: Run tests + run: | + ./bin/ci-tests.sh ${{ matrix.databases }} + - uses: actions/upload-artifact@v3 + with: + name: coverage + retention-days: 1 + path: | + *cov + sonar-cloud-analysis: runs-on: ubuntu-latest needs: [ci-test, golangci-lint] @@ -103,38 +103,38 @@ jobs: with: go-version: 1.21 - name: Download coverage artifacts - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: coverage - name: Download golangcilint artifacts - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: golangcilint - name: Check reports existence id: check_files uses: andstor/file-existence-action@v1 with: - files: '*.cov, golanglint.xml' + files: "*.cov, golanglint.xml" - name: Install Dependencies run: > go install github.com/wadey/gocovmerge@latest - + - name: merge reports run: | ./bin/merge-cov.sh - name: SonarCloud Scan uses: sonarsource/sonarcloud-github-action@master with: - args: > - -Dsonar.organization=tyktechnologies - -Dsonar.projectKey=TykTechnologies_tyk-identity-broker - -Dsonar.sources=. - -Dsonar.exclusions=ci/** - -Dsonar.coverage.exclusions=**/*_test.go,**/mocks/*.go - -Dsonar.test.inclusions=**/*_test.go - -Dsonar.tests=. - -Dsonar.go.coverage.reportPaths=*.cov - -Dsonar.go.golangci-lint.reportPaths=golanglint.xml + args: > + -Dsonar.organization=tyktechnologies + -Dsonar.projectKey=TykTechnologies_tyk-identity-broker + -Dsonar.sources=. + -Dsonar.exclusions=ci/** + -Dsonar.coverage.exclusions=**/*_test.go,**/mocks/*.go + -Dsonar.test.inclusions=**/*_test.go + -Dsonar.tests=. + -Dsonar.go.coverage.reportPaths=*.cov + -Dsonar.go.golangci-lint.reportPaths=golanglint.xml env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} \ No newline at end of file + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}