Skip to content

build(deps-dev): bump tmp from 0.2.5 to 0.2.7 in /web/vtadmin #40525

build(deps-dev): bump tmp from 0.2.5 to 0.2.7 in /web/vtadmin

build(deps-dev): bump tmp from 0.2.5 to 0.2.7 in /web/vtadmin #40525

name: Static Code Checks, Etc.
on:
push:
branches:
- "main"
- "release-[0-9]+.[0-9]"
tags: '**'
pull_request:
branches: '**'
permissions: read-all
jobs:
build:
name: Static Code Checks Etc
runs-on: ubuntu-24.04
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.19.0
with:
egress-policy: audit
- name: Skip CI
run: |
if [[ "${{contains( github.event.pull_request.labels.*.name, 'Skip CI')}}" == "true" ]]; then
echo "skipping CI due to the 'Skip CI' label"
exit 1
fi
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: 'false'
- name: Run FOSSA scan and upload build data
timeout-minutes: 5
uses: fossa-contrib/fossa-action@3d2ef181b1820d6dcd1972f86a767d18167fa19b # v3.0.1
with:
# This is a push-only API token: https://github.com/fossa-contrib/fossa-action#push-only-api-token
fossa-api-key: f62c11ef0c249fef239947f01279aa0f
github-token: ${{ github.token }}
- name: Check for changes in files
uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
id: changes
with:
token: ''
filters: |
go_files:
- '**/*.go'
- '*.go'
- 'go.sum'
- 'go.mod'
- '.github/workflows/static_checks_etc.yml'
parser_changes:
- 'go/vt/sqlparser/**'
- 'go.sum'
- 'go.mod'
- 'build.env'
- 'bootstrap.sh'
- 'tools/**'
- '.github/workflows/static_checks_etc.yml'
proto_changes:
- 'bootstrap.sh'
- 'tools/**'
- 'build.env'
- 'go.sum'
- 'go.mod'
- 'Makefile'
- 'go/vt/proto/**'
- 'proto/*.proto'
- '.github/workflows/static_checks_etc.yml'
sizegen:
- 'go/**/*.go'
- 'test.go'
- 'Makefile'
- 'build.env'
- 'go.sum'
- 'go.mod'
- 'tools/**'
- 'bootstrap.sh'
- '.github/workflows/static_checks_etc.yml'
visitor:
- 'go/tools/asthelpergen/**'
- 'go/vt/sqlparser/**'
- 'Makefile'
- 'build.env'
- 'go.sum'
- 'go.mod'
- 'tools/**'
- 'bootstrap.sh'
- 'misc/git/hooks/asthelpers'
- '.github/workflows/static_checks_etc.yml'
astfmt:
- 'go/tools/astfmtgen/**'
- 'go/vt/sqlparser/**'
- 'Makefile'
- 'build.env'
- 'go.sum'
- 'go.mod'
- 'tools/**'
- 'bootstrap.sh'
- '.github/workflows/static_checks_etc.yml'
end_to_end:
- 'docker/**'
- 'test.go'
- 'Makefile'
- 'bootstrap.sh'
- '.github/workflows/static_checks_etc.yml'
ci_config:
- 'test/config.json'
- '.github/workflows/static_checks_etc.yml'
release_notes:
- 'changelog/**'
- './go/tools/releases/**'
- '.github/workflows/static_checks_etc.yml'
github:
- '.github/**'
- 'Makefile'
- '.github/workflows/static_checks_etc.yml'
- name: Set up Go
if: (steps.changes.outputs.go_files == 'true' || steps.changes.outputs.parser_changes == 'true' || steps.changes.outputs.proto_changes == 'true')
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version-file: go.mod
cache: ${{ (github.base_ref == 'main' || (github.base_ref == '' && github.ref_name == 'main')) && 'true' || 'false' }}
- name: Tune the OS
if: steps.changes.outputs.go_files == 'true'
timeout-minutes: 5
uses: ./.github/actions/tune-os
- name: Get dependencies
if: (steps.changes.outputs.parser_changes == 'true' || steps.changes.outputs.go_files == 'true')
timeout-minutes: 5
run: |
sudo apt-get update
sudo apt-get install -y make unzip g++ etcd-client etcd-server curl git wget
sudo service etcd stop
go mod download
- name: Run make minimaltools
if: (steps.changes.outputs.parser_changes == 'true' || steps.changes.outputs.go_files == 'true')
timeout-minutes: 5
run: |
make minimaltools
- name: Install goimports
run: |
go install golang.org/x/tools/cmd/goimports@034e59c473362f8f2be47694d98fd3f12a1ad497 # v0.39.0
- name: Install yamllint
if: steps.changes.outputs.github == 'true'
run: pip install yamllint==1.38.0
- name: check_go_versions
run:
tools/check_go_versions.sh || exit 1
- name: check_make_parser
if: (steps.changes.outputs.parser_changes == 'true' || steps.changes.outputs.go_files == 'true')
run: |
tools/check_make_parser.sh || exit 1
- name: check_make_sizegen
if: (steps.changes.outputs.sizegen == 'true' || steps.changes.outputs.go_files == 'true')
run: |
tools/check_make_sizegen.sh || exit 1
- name: check_make_visitor
if: (steps.changes.outputs.visitor == 'true' || steps.changes.outputs.go_files == 'true')
run: |
misc/git/hooks/asthelpers || exit 1
- name: check_ast_format_fast
if: (steps.changes.outputs.astfmt == 'true' || steps.changes.outputs.go_files == 'true')
run: |
./tools/check_astfmtgen.sh || exit 1
- name: run ensure_bootstrap_version
if: steps.changes.outputs.end_to_end == 'true'
run: |
make ensure_bootstrap_version
git status
test -z "$(git diff-index --name-only HEAD --)" || exit 1
- name: Check .github YAML configs
if: steps.changes.outputs.github == 'true'
run: |
yamllint -d "{extends: relaxed, rules: {indentation: disable, line-length: disable, trailing-spaces: disable}}" \
.github/*.yml \
.github/ISSUE_TEMPLATE/*.yml \
.github/workflows/*.yml
- name: Get golangci-lint version
if: steps.changes.outputs.go_files == 'true'
id: golangci_lint_version
run: |
version=$(grep "^export GOLANGCI_LINT_VER=" build.env | cut -d= -f2)
if [ -z "$version" ]; then
echo "Could not determine GOLANGCI_LINT_VER from build.env"
exit 1
fi
echo "version=${version}" >> "$GITHUB_OUTPUT"
- name: Run golangci-lint
if: steps.changes.outputs.go_files == 'true'
timeout-minutes: 15
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.0.0
with:
args: --timeout 10m
install-mode: "goinstall"
skip-cache: true
working-directory: go
version: ${{ steps.golangci_lint_version.outputs.version }}
- name: Run go mod tidy
if: steps.changes.outputs.go_files == 'true'
run: |
set -e
go mod tidy
output=$(git status -s)
if [ -z "${output}" ]; then
exit 0
fi
echo 'We wish to maintain a tidy state for go mod. Please run `go mod tidy` on your branch, commit and push again.'
echo 'Running `go mod tidy` on this CI test yields with the following changes:'
echo "$output"
exit 1
- name: Setup Node
if: steps.changes.outputs.proto_changes == 'true'
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
# make proto requires newer node than the pre-installed one
node-version: '22.13.1'
- name: check_make_proto
if: steps.changes.outputs.proto_changes == 'true'
run: |
tools/check_make_proto.sh || exit 1
- name: Check test/config.json
if: (steps.changes.outputs.go_files == 'true' || steps.changes.outputs.ci_config == 'true')
run: |
go run ./go/tools/ci-config/main.go || exit 1
- name: Check changelog
if: steps.changes.outputs.release_notes == 'true'
run: |
set -e
go run ./go/tools/releases/releases.go
output=$(git status -s)
if [ -z "${output}" ]; then
exit 0
fi
echo 'We wish to maintain a consistent changelog directory, please run `go run ./go/tools/releases/releases.go`, commit and push again.'
echo 'Running `go run ./go/tools/releases/releases.go` on CI yields the following changes:'
echo "$output"
echo ""
exit 1