Skip to content

Golang

Golang #1519

Workflow file for this run

# Copyright 2023 The Cockroach Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
# This is our top-level workflow that kicks off the various go- workflows.
name: Golang
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
# Since we use the merge queue to push and there are no observable
# side-effects of running a test-only workflow, we don't respond to
# push events.
merge_group: # Enable merge queue
pull_request:
paths:
- 'go.mod'
- 'go.sum'
- '**/*.go'
- '.github/workflows/go*.yaml'
push:
branches: [ master ]
tags: [ 'v*.*.*' ]
jobs:
# Most jobs should depend on this one.
go-build-cache:
uses: ./.github/workflows/go-build-cache.yaml
go-binaries:
uses: ./.github/workflows/go-binaries.yaml
needs:
- go-build-cache
permissions:
contents: read
id-token: write
statuses: write
secrets: inherit
go-codeql:
uses: ./.github/workflows/go-codeql.yaml
needs:
- go-build-cache
permissions:
contents: read
security-events: write
secrets: inherit
go-docker:
uses: ./.github/workflows/go-docker.yaml
# Doesn't need the build cache
permissions:
contents: read
packages: write
secrets: inherit
with:
enable_docker_hub: ${{ startsWith(github.ref, 'refs/tags/v') || github.ref=='refs/heads/master' }}
go-tests:
uses: ./.github/workflows/go-tests.yaml
needs:
- go-build-cache
# We use the merge queue prior to pushing to a branch, so there's no
# reason to repeat tests that just ran.
if: ${{ github.event_name != 'push' }}
permissions:
contents: read
packages: read
statuses: write
secrets: inherit
go-wiki:
uses: ./.github/workflows/go-wiki.yaml
needs:
- go-build-cache
permissions:
contents: write
secrets: inherit
with:
# Only update the wiki if we're merging into the master branch.
push: ${{ github.event.merge_group.base_ref == 'refs/heads/master' }}