Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
154 changes: 85 additions & 69 deletions .github/workflows/pull-request-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,81 +7,97 @@ on:
- main

jobs:
ci-lint:
name: Lint
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
actions: read
steps:
- name: Linting Go
uses: smartcontractkit/.github/actions/ci-lint-go@ci-lint-go/v2 # [email protected]
with:
only-new-issues: "false"
golangci-lint-version: v2.5.0

ci-lint-misc:
name: Lint GH Actions and scripts
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Linting Misc (yaml + sh files)
uses: smartcontractkit/.github/actions/ci-lint-misc@eeb76b5870e3c17856d5a60fd064a053c023b5f5 # [email protected]

ci-test:
name: Tests
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
id-token: write
contents: read
actions: read
steps:
- name: Build and test
uses: smartcontractkit/.github/actions/ci-test-go@dfcba48f05933158428bce867d790e3d5a9baa6b # [email protected]
with:
# disable the checkptr runtime check due a false positive in github.com/xssnick/tonutils-go
# causing tests in ci to fail "fatal error: checkptr: pointer arithmetic result points to invalid allocation"
# https://github.com/xssnick/tonutils-go/issues/310
# Exclude provider packages which use Docker containers
go-test-cmd: go test -race -gcflags=all=-d=checkptr=0 -coverprofile=coverage.txt $(go list ./... | grep -v '/provider')
use-go-cache: true
artifact-name: unit-tests

ci-test-provider:
name: Provider Tests
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
id-token: write
contents: read
actions: read
steps:
- name: Build and test provider packages
uses: smartcontractkit/.github/actions/ci-test-go@dfcba48f05933158428bce867d790e3d5a9baa6b # [email protected]
with:
# disable the checkptr runtime check due a false positive in github.com/xssnick/tonutils-go
# causing tests in ci to fail "fatal error: checkptr: pointer arithmetic result points to invalid allocation"
# https://github.com/xssnick/tonutils-go/issues/310
# -p 2 -parallel 3 = 2 packages, 3 tests max = 6 containers max
# Only run provider packages which use Docker containers
go-test-cmd: go test -race -gcflags=all=-d=checkptr=0 -p 2 -parallel 3 -coverprofile=coverage.txt $(go list ./... | grep '/provider')
use-go-cache: true
artifact-name: provider-tests

sonarqube:
name: Sonar Scan
if: github.event_name == 'pull_request'
runs-on: ubuntu-24.04
needs: [ci-test, ci-test-provider, ci-lint-misc, ci-lint]
permissions:
contents: read
actions: read
steps:
- name: Scan with Sonarqube
uses: smartcontractkit/.github/actions/ci-sonarqube-go@01d931b0455a754d12e7143cc54a5a3521a8f6f6 # [email protected]
- name: Pull Catalog Service ECR Image
uses: smartcontractkit/.github/actions/pull-private-ecr-image@2f8f0baf38e46140c6a119eb551a56eaaabcc09e # [email protected]
with:
sonar-token: ${{ secrets.SONAR_TOKEN }}
sonar-host-url: ${{ secrets.SONAR_HOST_URL }}
aws-account-number: ${{ secrets.AWS_ACCOUNT_NUMBER_PROD }}
aws-region: ${{ secrets.AWS_REGION }}
aws-role-arn: ${{ secrets.ECR_READ_ROLE_ARN }}
ecr-repository: "op-catalog-service"
image-tag: "v0.0.1"
# ci-lint:
# name: Lint
# runs-on: ubuntu-latest
# permissions:
# id-token: write
# contents: read
# actions: read
# steps:
# - name: Linting Go
# uses: smartcontractkit/.github/actions/ci-lint-go@ci-lint-go/v2 # [email protected]
# with:
# only-new-issues: "false"
# golangci-lint-version: v2.5.0
#
# ci-lint-misc:
# name: Lint GH Actions and scripts
# runs-on: ubuntu-latest
# permissions:
# contents: read
# steps:
# - name: Linting Misc (yaml + sh files)
# uses: smartcontractkit/.github/actions/ci-lint-misc@eeb76b5870e3c17856d5a60fd064a053c023b5f5 # [email protected]
#
# ci-test:
# name: Tests
# runs-on: ubuntu-latest
# timeout-minutes: 10
# permissions:
# id-token: write
# contents: read
# actions: read
# steps:
# - name: Build and test
# uses: smartcontractkit/.github/actions/ci-test-go@dfcba48f05933158428bce867d790e3d5a9baa6b # [email protected]
# with:
# # disable the checkptr runtime check due a false positive in github.com/xssnick/tonutils-go
# # causing tests in ci to fail "fatal error: checkptr: pointer arithmetic result points to invalid allocation"
# # https://github.com/xssnick/tonutils-go/issues/310
# # Exclude provider packages which use Docker containers
# go-test-cmd: go test -race -gcflags=all=-d=checkptr=0 -coverprofile=coverage.txt $(go list ./... | grep -v '/provider')
# use-go-cache: true
# artifact-name: unit-tests
#
# ci-test-provider:
# name: Provider Tests
# runs-on: ubuntu-latest
# timeout-minutes: 10
# permissions:
# id-token: write
# contents: read
# actions: read
# steps:
# - name: Build and test provider packages
# uses: smartcontractkit/.github/actions/ci-test-go@dfcba48f05933158428bce867d790e3d5a9baa6b # [email protected]
# with:
# # disable the checkptr runtime check due a false positive in github.com/xssnick/tonutils-go
# # causing tests in ci to fail "fatal error: checkptr: pointer arithmetic result points to invalid allocation"
# # https://github.com/xssnick/tonutils-go/issues/310
# # -p 2 -parallel 3 = 2 packages, 3 tests max = 6 containers max
# # Only run provider packages which use Docker containers
# go-test-cmd: go test -race -gcflags=all=-d=checkptr=0 -p 2 -parallel 3 -coverprofile=coverage.txt $(go list ./... | grep '/provider')
# use-go-cache: true
# artifact-name: provider-tests
#
# sonarqube:
# name: Sonar Scan
# if: github.event_name == 'pull_request'
# runs-on: ubuntu-24.04
# needs: [ci-test, ci-test-provider, ci-lint-misc, ci-lint]
# permissions:
# contents: read
# actions: read
# steps:
# - name: Scan with Sonarqube
# uses: smartcontractkit/.github/actions/ci-sonarqube-go@01d931b0455a754d12e7143cc54a5a3521a8f6f6 # [email protected]
# with:
# sonar-token: ${{ secrets.SONAR_TOKEN }}
# sonar-host-url: ${{ secrets.SONAR_HOST_URL }}
Loading