Skip to content

Commit 3a6235e

Browse files
sravottoclaude
andcommitted
ci: bump GitHub Actions to latest major versions for Node.js 24
Update all workflow actions to resolve Node.js 20 deprecation warnings: - actions/checkout v3/v4 → v5 - github/codeql-action v3 → v4 - docker/setup-buildx-action v2 → v3 - docker/setup-qemu-action v3 → v4 - docker/setup-buildx-action v3 → v4 - docker/metadata-action v5 → v6 - docker/login-action v3 → v4 - docker/build-push-action v6 → v7 Remove redundant manual actions/cache steps from tests.yaml. actions/setup-go@v5 already caches the Go module and build directories, so the extra cache caused "File exists" tar extraction errors. Making sure that the version is correcly added when building binaries and docker images. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 7269226 commit 3a6235e

8 files changed

Lines changed: 74 additions & 75 deletions

File tree

‎.github/workflows/binaries.yaml‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ jobs:
6262
BUILDNAME: visus-${{ matrix.os }}-${{ matrix.arch }}
6363
OUTPUT: visus-${{ matrix.os }}-${{ matrix.arch }}
6464
steps:
65-
- uses: actions/checkout@v4
65+
- uses: actions/checkout@v5
6666

6767
- name: Set up Go
68-
uses: actions/setup-go@v5
68+
uses: actions/setup-go@v6
6969
with:
7070
go-version-file: 'go.mod'
7171

@@ -77,10 +77,11 @@ jobs:
7777
go
7878
build
7979
-v
80-
-ldflags="-s -w"
80+
-ldflags="-s -w -X github.com/cockroachlabs/visus/internal/http.Version=$VERSION"
8181
-o $OUTPUT
8282
.
8383
env:
84+
VERSION: ${{ github.event.release.tag_name || github.ref_name }}
8485
CGO_ENABLED: 0
8586
GOOS: ${{ matrix.os }}
8687
GOARCH: ${{ matrix.arch }}

‎.github/workflows/codeql.yaml‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,23 +34,23 @@ jobs:
3434
name: CodeQL security scanning
3535
runs-on: ubuntu-latest
3636
steps:
37-
- uses: actions/checkout@v4
37+
- uses: actions/checkout@v5
3838

3939
- name: Set up Go
40-
uses: actions/setup-go@v5
40+
uses: actions/setup-go@v6
4141
with:
4242
go-version-file: 'go.mod'
4343

4444
- name: Initialize CodeQL
45-
uses: github/codeql-action/init@v3
45+
uses: github/codeql-action/init@v4
4646
with:
4747
languages: go
4848
queries: security-and-quality
4949

5050
- name: Autobuild
51-
uses: github/codeql-action/autobuild@v3
51+
uses: github/codeql-action/autobuild@v4
5252

5353
- name: Perform CodeQL Analysis
54-
uses: github/codeql-action/analyze@v3
54+
uses: github/codeql-action/analyze@v4
5555
with:
5656
category: "/language:go"
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Copyright 2026 The Cockroach Authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
# SPDX-License-Identifier: Apache-2.0
16+
17+
# Weekly Trivy scan of the latest published Docker image for known CVEs.
18+
name: Docker Image Scan (Published)
19+
permissions:
20+
contents: read
21+
security-events: write
22+
on:
23+
schedule:
24+
- cron: '0 7 * * 1'
25+
workflow_dispatch:
26+
jobs:
27+
scan-published:
28+
name: Scan latest published image
29+
runs-on: ubuntu-latest
30+
env:
31+
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
32+
steps:
33+
- name: Run Trivy vulnerability scanner
34+
uses: aquasecurity/trivy-action@master
35+
with:
36+
image-ref: 'cockroachdb/visus:latest'
37+
format: 'sarif'
38+
output: 'trivy-results.sarif'
39+
40+
- name: Upload Trivy scan results to GitHub Security tab
41+
uses: github/codeql-action/upload-sarif@v4
42+
with:
43+
sarif_file: 'trivy-results.sarif'
44+
category: 'trivy-published'
Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -14,28 +14,28 @@
1414
#
1515
# SPDX-License-Identifier: Apache-2.0
1616

17-
# Weekly Trivy scan of the Docker image for known CVEs.
18-
name: Docker Image Scan
17+
# Trivy scan of the Docker image built from source on PRs.
18+
name: Docker Image Scan (Source)
1919
permissions:
2020
contents: read
2121
security-events: write
2222
on:
2323
pull_request:
2424
paths:
25-
- '.github/workflows/docker-scan.yaml'
26-
schedule:
27-
- cron: '0 7 * * 1'
25+
- '.github/workflows/docker-scan-source.yaml'
2826
workflow_dispatch:
2927
jobs:
3028
scan-source:
3129
name: Scan image built from source
3230
runs-on: ubuntu-latest
31+
env:
32+
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
3333
steps:
3434
- name: Checkout
35-
uses: actions/checkout@v4
35+
uses: actions/checkout@v5
3636

3737
- name: Set up Docker Buildx
38-
uses: docker/setup-buildx-action@v2
38+
uses: docker/setup-buildx-action@v4
3939

4040
- name: Build image
4141
run: docker build -t visus:scan .
@@ -52,20 +52,3 @@ jobs:
5252
with:
5353
sarif_file: 'trivy-results.sarif'
5454
category: 'trivy-source'
55-
56-
scan-published:
57-
name: Scan latest published image
58-
runs-on: ubuntu-latest
59-
steps:
60-
- name: Run Trivy vulnerability scanner
61-
uses: aquasecurity/trivy-action@master
62-
with:
63-
image-ref: 'cockroachdb/visus:latest'
64-
format: 'sarif'
65-
output: 'trivy-results.sarif'
66-
67-
- name: Upload Trivy scan results to GitHub Security tab
68-
uses: github/codeql-action/upload-sarif@v4
69-
with:
70-
sarif_file: 'trivy-results.sarif'
71-
category: 'trivy-published'

‎.github/workflows/docker.yaml‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@ jobs:
4242
runs-on: ubuntu-latest
4343
steps:
4444
- name: Checkout
45-
uses: actions/checkout@v3
45+
uses: actions/checkout@v5
4646
- name: Set up QEMU
47-
uses: docker/setup-qemu-action@v2
47+
uses: docker/setup-qemu-action@v4
4848
- name: Set up Docker Buildx
49-
uses: docker/setup-buildx-action@v2
49+
uses: docker/setup-buildx-action@v4
5050
- name: Docker meta
5151
id: meta
52-
uses: docker/metadata-action@v4
52+
uses: docker/metadata-action@v6
5353
with:
5454
images: cockroachdb/visus
5555
labels: |
@@ -58,17 +58,18 @@ jobs:
5858
org.opencontainers.image.descripton=Prototype, not officially supported
5959
- name: Login to DockerHub
6060
if: github.event_name != 'pull_request'
61-
uses: docker/login-action@v2
61+
uses: docker/login-action@v4
6262
with:
6363
username: ${{ secrets.DOCKERHUB_USERNAME }}
6464
password: ${{ secrets.DOCKERHUB_TOKEN }}
6565
- name: Build and push
66-
uses: docker/build-push-action@v3
66+
uses: docker/build-push-action@v7
6767
with:
6868
context: .
6969
platforms: linux/amd64,linux/arm64
7070
push: ${{ github.event_name != 'pull_request' }}
7171
tags: ${{ steps.meta.outputs.tags }}
7272
labels: ${{ steps.meta.outputs.labels }}
73+
build-args: VERSION=${{ github.ref_name }}
7374
cache-from: type=gha
7475
cache-to: type=gha,mode=max

‎.github/workflows/key-lint.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
runs-on: ubuntu-latest
2929
steps:
3030
- name: Check out source
31-
uses: actions/checkout@v4
31+
uses: actions/checkout@v5
3232

3333
- name: Check for CRDB license keys
3434
run: |

‎.github/workflows/tests.yaml‎

Lines changed: 4 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -32,33 +32,15 @@ jobs:
3232
name: Code Quality
3333
runs-on: ubuntu-latest
3434
steps:
35-
- uses: actions/checkout@v4
35+
- uses: actions/checkout@v5
3636

3737
- name: Set up Go
38-
uses: actions/setup-go@v5
38+
uses: actions/setup-go@v6
3939
with:
4040
go-version-file: go.mod
4141

42-
- name: Determine paths to cache
43-
id: cache
44-
run: |
45-
echo "go-build=$(go env GOCACHE)" >> $GITHUB_OUTPUT
46-
echo "go-mod=$(go env GOMODCACHE)">> $GITHUB_OUTPUT
47-
48-
- name: Go Build Cache
49-
uses: actions/cache@v4
50-
with:
51-
path: |
52-
${{ steps.cache.outputs.go-build }}
53-
${{ steps.cache.outputs.go-mod }}
54-
key: ${{ runner.os }}-quality-${{ hashFiles('**/go.sum') }}
55-
5642
- name: Copyright headers
5743
run: go run github.com/google/addlicense -c "The Cockroach Authors" -l apache -s -v -check -ignore '**/testdata/**/*' .
58-
59-
# This action should, in general, be a no-op, given the cache above.
60-
- name: Download all deps
61-
run: go mod download
6244

6345
- name: crlfmt returns no deltas
6446
if: ${{ !cancelled() }}
@@ -85,25 +67,12 @@ jobs:
8567
env:
8668
COVER_OUT: coverage.out
8769
steps:
88-
- uses: actions/checkout@v4
70+
- uses: actions/checkout@v5
8971

9072
- name: Set up Go
91-
uses: actions/setup-go@v5
73+
uses: actions/setup-go@v6
9274
with:
9375
go-version-file: go.mod
9476

95-
- name: Determine paths to cache
96-
id: cache
97-
run: |
98-
echo "go-build=$(go env GOCACHE)" >> $GITHUB_OUTPUT
99-
echo "go-mod=$(go env GOMODCACHE)">> $GITHUB_OUTPUT
100-
101-
- name: Go Build Cache
102-
uses: actions/cache@v4
103-
with:
104-
path: |
105-
${{ steps.cache.outputs.go-build }}
106-
${{ steps.cache.outputs.go-mod }}
107-
key: ${{ runner.os }}-integration-${{ hashFiles('**/go.sum') }}
10877
- name: Go Tests
10978
run: go test -v -race -coverpkg=./internal/... -covermode=atomic -coverprofile=${{ env.COVER_OUT }} ./...

‎Dockerfile‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@
1515
# SPDX-License-Identifier: Apache-2.0
1616

1717
FROM golang:1.25 AS builder
18+
ARG VERSION
1819
WORKDIR /tmp/compile
1920
COPY . .
20-
RUN CGO_ENABLED=0 go build -v -ldflags="-s -w " -o /usr/bin/visus .
21+
RUN CGO_ENABLED=0 go build -v -ldflags="-s -w -X github.com/cockroachlabs/visus/internal/http.Version=$VERSION" -o /usr/bin/visus .
2122

2223
# Create a single-binary docker image, including a set of core CA
2324
# certificates so that we can call out to any external APIs.

0 commit comments

Comments
 (0)