Skip to content

Adding aptos service #10197

Adding aptos service

Adding aptos service #10197

Workflow file for this run

name: golangci-lint
on: [pull_request, merge_group]
jobs:
detect-modules:
runs-on: ubuntu-latest
outputs:
modules: ${{ steps.set-modules.outputs.modules }}
steps:
- uses: actions/checkout@v5
- id: set-modules
run: |
# Find all go.mod files and extract their directories
modules=$(find . -name "go.mod" -not -path "./vendor/*" -exec dirname {} \; | jq -R -s -c 'split("\n") | map(select(. != ""))')
echo "modules=${modules}" >> $GITHUB_OUTPUT
echo "Found modules: ${modules}"
lint-module:
# Avoid running in merge queue since we run in PR's and have an optional
# label to skip lint issues on a PR which would be ignored in the merge queue.
if: ${{ github.event_name != 'merge_group' }}
needs: detect-modules
runs-on: ubuntu-latest
# Modules are independent
continue-on-error: true
strategy:
matrix:
module: ${{ fromJSON(needs.detect-modules.outputs.modules) }}
permissions:
id-token: write
contents: read
actions: read
pull-requests: read
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
persist-credentials: false
- name: Get golangci-lint version from asdf
id: get-version
run: |
version=$(grep '^golangci-lint ' .tool-versions | awk '{print $2}')
echo "version=${version}" | tee -a "$GITHUB_OUTPUT"
- name: Sanitize artifact name
id: artifact-name
env:
MODULE: ${{ matrix.module }}
run: |
safe_name="${MODULE#./}"
safe_name="${safe_name#/}"
safe_name="${safe_name//\//-}"
if [[ -z "$safe_name" || "$safe_name" = "." ]]; then
safe_name="root"
fi
echo "value=golangci-lint-report-${safe_name}" | tee -a "$GITHUB_OUTPUT"
- name: golangci-lint ${{ matrix.module }}
if: ${{ always() && !contains(join(github.event.pull_request.labels.*.name, ' '), 'allow-lint-issues') }}
# NOTE: Keep this version in sync with ACTION_CI_LINT_GO_GIT_TAG in ./script/lint.sh
uses: smartcontractkit/.github/actions/ci-lint-go@ci-lint-go/v4
with:
checkout-repo: false
artifact-name: ${{ steps.artifact-name.outputs.value }}
golangci-lint-version: v${{ steps.get-version.outputs.version }}
go-directory: ${{ matrix.module }}
golangci-lint-args: "--output.text.path=stdout --output.checkstyle.path=${{ github.workspace }}/${{ matrix.module }}/golangci-lint-report.xml"
golangci-lint:
# Required sink job that waits for all lint jobs to complete
if: ${{ github.event_name != 'merge_group' }}
needs: [detect-modules, lint-module]
runs-on: ubuntu-latest
steps:
- name: Lint complete
run: echo "All lint jobs completed"