Skip to content

Bump actions/setup-go from 6.1.0 to 6.2.0 #1049

Bump actions/setup-go from 6.1.0 to 6.2.0

Bump actions/setup-go from 6.1.0 to 6.2.0 #1049

Workflow file for this run

name: build
on:
push:
branches:
- main
pull_request:
types:
- opened
- synchronize
- reopened
paths-ignore:
- ".github/labeler.yml"
- ".github/pages.yml"
- ".github/release.yml"
- ".github/workflows/labeler.yml"
- ".github/workflows/rbs-collection-updater.yml"
- "_benchmark/**"
env:
GO_TEST_ARGS: -coverprofile coverage.out -covermode atomic
TEST_GEM_DIR: ruby/testdata/example/
jobs:
generate-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- id: set-matrix
run: echo "matrix=$(cat matrix.json | jq -c)" >> $GITHUB_OUTPUT
working-directory: .github/workflows/
build-and-test:
name: "build-and-test (Go ${{ matrix.go }}, Ruby ${{ matrix.ruby }}, Runner ${{ matrix.runner }})"
needs:
- generate-matrix
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
go: ${{ fromJSON(needs.generate-matrix.outputs.matrix).go }}
ruby: ${{ fromJSON(needs.generate-matrix.outputs.matrix).ruby }}
runner:
- ubuntu-latest
- macos-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
with:
go-version: ${{ matrix.go }}
- uses: ruby/setup-ruby@8d27f39a5e7ad39aebbcbd1324f7af020229645c # v1.287.0
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: build and test (Go)
run: |
set -xe
bundle exec rake go:test
bundle exec rake go:testrace
- name: build and test (Ruby)
run: bundle exec rake
working-directory: ${{ env.TEST_GEM_DIR }}
# FIXME: workaround for gcov2lcov warning
- run: rm -rf vendor/
- name: Coveralls
uses: coverallsapp/github-action@5cbfd81b66ca5d10c19b062c04de0199c215fb6e # v2.3.7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
file: coverage.out
format: golang
continue-on-error: true # NOTE: secrets cannot be obtained with forked repository PR
- name: Slack Notification (not success)
uses: act10ns/slack@cfcc30955fe9377f4f55e1079e5419ee1014269f # v2
if: "! success()"
continue-on-error: true
with:
status: ${{ job.status }}
webhook-url: ${{ secrets.SLACK_WEBHOOK }}
matrix: ${{ toJson(matrix) }}
go-lint:
name: "go-lint (Ruby ${{ matrix.ruby }})"
needs:
- generate-matrix
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby: ${{ fromJSON(needs.generate-matrix.outputs.matrix).ruby }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
with:
go-version-file: "go.mod"
- uses: ruby/setup-ruby@8d27f39a5e7ad39aebbcbd1324f7af020229645c # v1.287.0
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: export CGO_CFLAGS for golangci-lint
run: bundle exec rake go:build_envs[CGO_CFLAGS] >> $GITHUB_ENV
- run: echo $CGO_CFLAGS
- name: export BUILD_TAG for golangci-lint
run: echo "BUILD_TAG=$(bundle exec rake go:build_tag)" >> $GITHUB_ENV
- run: echo $BUILD_TAG
- name: golangci-lint
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0
with:
version-file: .golangci-lint-version
args: --build-tags ${{ env.BUILD_TAG }} --modules-download-mode=readonly
- name: Slack Notification (not success)
uses: act10ns/slack@cfcc30955fe9377f4f55e1079e5419ee1014269f # v2
if: "! success()"
continue-on-error: true
with:
status: ${{ job.status }}
webhook-url: ${{ secrets.SLACK_WEBHOOK }}
go-govulncheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
with:
go-version-file: go.mod
cache: true
- run: go install golang.org/x/vuln/cmd/govulncheck@latest
- uses: ruby/setup-ruby@8d27f39a5e7ad39aebbcbd1324f7af020229645c # v1.287.0
with:
ruby-version: .tool-versions
bundler-cache: true
- name: export CGO_CFLAGS for govulncheck
run: bundle exec rake go:build_envs[CGO_CFLAGS] >> $GITHUB_ENV
- run: echo $CGO_CFLAGS
- name: export BUILD_TAG for govulncheck
run: echo "BUILD_TAG=$(bundle exec rake go:build_tag)" >> $GITHUB_ENV
- run: echo $BUILD_TAG
# FIXME: Workaround for following error
#
# govulncheck: loading packages: err: exit status 1: stderr: go: inconsistent vendoring in /home/runner/work/go-gem-wrapper/go-gem-wrapper:
# github.com/stretchr/testify@v1.11.1: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
# github.com/davecgh/go-spew@v1.1.1: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
# github.com/pmezard/go-difflib@v1.0.0: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
# gopkg.in/yaml.v3@v3.0.1: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
#
# To ignore the vendor directory, use -mod=readonly or -mod=mod.
# To sync the vendor directory, run:
# go mod vendor
- run: rm -rf vendor/
# FIXME: golang/govulncheck-action@v1 doesn't support `-tags` arg
# - uses: golang/govulncheck-action@v1
# with:
# go-version-file: go.mod
- run: govulncheck -format text -tags "${BUILD_TAG}" ./...
- name: Slack Notification (not success)
uses: act10ns/slack@cfcc30955fe9377f4f55e1079e5419ee1014269f # v2
if: "! success()"
continue-on-error: true
with:
status: ${{ job.status }}
webhook-url: ${{ secrets.SLACK_WEBHOOK }}
ruby-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: ruby/setup-ruby@8d27f39a5e7ad39aebbcbd1324f7af020229645c # v1.287.0
with:
ruby-version: .tool-versions
bundler-cache: true
- run: bundle exec rake ruby:rubocop
- name: Slack Notification (not success)
uses: act10ns/slack@cfcc30955fe9377f4f55e1079e5419ee1014269f # v2
if: "! success()"
continue-on-error: true
with:
status: ${{ job.status }}
webhook-url: ${{ secrets.SLACK_WEBHOOK }}
ruby-rbs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: ruby/setup-ruby@8d27f39a5e7ad39aebbcbd1324f7af020229645c # v1.287.0
with:
ruby-version: .tool-versions
bundler-cache: true
- run: bundle exec rbs collection install
- run: bundle exec rbs validate
- run: bundle exec steep check
- name: Slack Notification (not success)
uses: act10ns/slack@cfcc30955fe9377f4f55e1079e5419ee1014269f # v2
if: "! success()"
continue-on-error: true
with:
status: ${{ job.status }}
webhook-url: ${{ secrets.SLACK_WEBHOOK }}
ruby-yard:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: ruby/setup-ruby@8d27f39a5e7ad39aebbcbd1324f7af020229645c # v1.287.0
with:
ruby-version: .tool-versions
bundler-cache: true
- name: yard generating test
run: |
set -xe
bundle exec yard
ls -ld doc/
- name: Slack Notification (not success)
uses: act10ns/slack@cfcc30955fe9377f4f55e1079e5419ee1014269f # v2
if: "! success()"
continue-on-error: true
with:
status: ${{ job.status }}
webhook-url: ${{ secrets.SLACK_WEBHOOK }}
go_gem:
name: "go_gem (Ruby ${{ matrix.ruby }})"
needs:
- generate-matrix
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby: ${{ fromJSON(needs.generate-matrix.outputs.matrix).ruby }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: ruby/setup-ruby@8d27f39a5e7ad39aebbcbd1324f7af020229645c # v1.287.0
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- run: bundle exec rake go_gem:test
- name: Slack Notification (not success)
uses: act10ns/slack@cfcc30955fe9377f4f55e1079e5419ee1014269f # v2
if: "! success()"
continue-on-error: true
with:
status: ${{ job.status }}
webhook-url: ${{ secrets.SLACK_WEBHOOK }}
matrix: ${{ toJson(matrix) }}
all-pass-build:
if: always()
needs:
- build-and-test
- go-lint
- go-govulncheck
- ruby-lint
- ruby-rbs
- ruby-yard
- go_gem
runs-on: ubuntu-latest
steps:
- name: check dependent jobs
uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # v1.2.2
with:
jobs: ${{ toJSON(needs) }}