Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update runner to Go 1.22,1.23 (two most recent releases). #887

Merged
merged 17 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 46 additions & 22 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
fail-fast: false
matrix:
go: ['1.20', '1.21', 'tip']
go: ['1.22', '1.23', 'tip']
# Supported macOS versions can be found in
# https://github.com/actions/virtual-environments#available-environments.
# TODO: Add macos-13. As of now there are build errors when installing graphviz.
Expand All @@ -28,11 +28,27 @@ jobs:
# - https://github.com/actions/virtual-environments/blob/main/images/macos/macos-13-Readme.md#xcode
xcode-version: ['14.2', '14.1', '14.0.1', '13.4.1', '13.3.1', '13.2.1', '13.1']
steps:
- name: Checkout the repo
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
path: ${{ env.WORKING_DIR }}

- name: Update Go version using setup-go
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
if: matrix.go != 'tip'
with:
go-version: ${{ matrix.go }}
cache: true
cache-dependency-path: '**/go.sum'

- name: Install Go bootstrap compiler
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
if: matrix.go == 'tip'
with:
# Bootstrapping go tip requires 1.22.6
go-version: 1.22
cache: true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are these cache manipulation needed?

May worth a comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without these we get errors from setup-go about it not being able to use the cache. (I think it might be related to having multiple go.sum files in our repo). I will add a comment.

cache-dependency-path: '**/go.sum'

- name: Update Go version manually
if: matrix.go == 'tip'
Expand All @@ -46,11 +62,6 @@ jobs:
echo "RUN_GOLANGCI_LINTER=false" >> $GITHUB_ENV
echo "$HOME/gotip/bin:$PATH" >> $GITHUB_PATH

- name: Checkout the repo
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
path: ${{ env.WORKING_DIR }}

- name: Set up Xcode
uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0
with:
Expand All @@ -61,8 +72,8 @@ jobs:
brew install graphviz
# Do not let tools interfere with the main module's go.mod.
cd && go mod init tools
go install honnef.co/go/tools/cmd/staticcheck@v0.4.6
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.51.0
go install honnef.co/go/tools/cmd/staticcheck@v0.5.1
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.60.3
# Add PATH for installed tools.
echo "$GOPATH/bin:$PATH" >> $GITHUB_PATH

Expand All @@ -84,14 +95,30 @@ jobs:
strategy:
fail-fast: false
matrix:
go: ['1.20', '1.21', 'tip']
go: ['1.22', '1.23', 'tip']
os: ['ubuntu-22.04', 'ubuntu-20.04']
steps:
- name: Checkout the repo
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
path: ${{ env.WORKING_DIR }}

- name: Update Go version using setup-go
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
if: matrix.go != 'tip'
with:
go-version: ${{ matrix.go }}
cache: true
cache-dependency-path: '**/go.sum'

- name: Install Go bootstrap compiler
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
if: matrix.go == 'tip'
with:
# Bootstrapping go tip requires 1.22.6
go-version: 1.22
cache: true
cache-dependency-path: '**/go.sum'

- name: Update Go version manually
if: matrix.go == 'tip'
Expand All @@ -105,11 +132,6 @@ jobs:
echo "RUN_GOLANGCI_LINTER=false" >> $GITHUB_ENV
echo "$HOME/gotip/bin" >> $GITHUB_PATH

- name: Checkout the repo
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
path: ${{ env.WORKING_DIR }}

- name: Check chrome for browser tests
run: |
google-chrome --version
Expand All @@ -119,8 +141,8 @@ jobs:
sudo apt-get install graphviz
# Do not let tools interfere with the main module's go.mod.
cd && go mod init tools
go install honnef.co/go/tools/cmd/staticcheck@v0.4.6
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.51.0
go install honnef.co/go/tools/cmd/staticcheck@v0.5.1
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.60.3
# Add PATH for installed tools.
echo "$GOPATH/bin:$PATH" >> $GITHUB_PATH

Expand All @@ -139,18 +161,20 @@ jobs:
strategy:
fail-fast: false
matrix:
go: ['1.20', '1.21']
go: ['1.22', '1.23']
steps:
- name: Update Go version using setup-go
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: ${{ matrix.go }}

- name: Checkout the repo
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
path: ${{ env.WORKING_DIR }}

- name: Update Go version using setup-go
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: ${{ matrix.go }}
cache: true
cache-dependency-path: '**/go.sum'

- name: Fetch Windows dependency
uses: crazy-max/ghaction-chocolatey@0e015857dd851f84fcb7fb53380eb5c4c8202333 # v3.0.0
with:
Expand Down
2 changes: 1 addition & 1 deletion browsertests/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/google/pprof/browsertests

go 1.19
go 1.22

// Use the version of pprof in this directory tree.
replace github.com/google/pprof => ../
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/google/pprof

go 1.19
go 1.22

require (
github.com/chzyer/readline v1.5.1
Expand Down
Loading