Skip to content

Commit

Permalink
chore: upgrade to go v1.22 (#802)
Browse files Browse the repository at this point in the history
Issue #, if available:

*Description of changes:*
- Upgrade `go.mod` and run `go mod tidy`
- Remove unnecessary `brew install go` since we are already using
`actions/setup-go` and brew may be outdated

*Testing done:*
- Built finch locally


- [x] I've reviewed the guidance in CONTRIBUTING.md


#### License Acceptance

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license.

---------

Signed-off-by: Justin Alvarez <[email protected]>
  • Loading branch information
pendo324 authored Feb 12, 2024
1 parent 2e616ff commit 1bfe484
Show file tree
Hide file tree
Showing 39 changed files with 388 additions and 961 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/build-and-test-pkg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,9 @@ jobs:
with:
go-version-file: go.mod
cache: true

- name: Make macos aarch64 build
run: |
brew install go lz4 automake autoconf libtool
brew install lz4 automake autoconf libtool
git status
git clean -f -d
make clean
Expand Down Expand Up @@ -92,7 +91,7 @@ jobs:

- name: Make macos x86_64 build
run: |
brew install go lz4 automake autoconf libtool
brew install lz4 automake autoconf libtool
git status
git clean -f -d
make clean
Expand Down Expand Up @@ -167,7 +166,7 @@ jobs:
run: echo "A" | softwareupdate --install-rosetta || true
- name: Build project
run: |
brew install go lz4 automake autoconf libtool
brew install lz4 automake autoconf libtool
export PATH="/opt/homebrew/opt/libtool/libexec/gnubin:$PATH"
make
shell: zsh {0}
Expand Down Expand Up @@ -279,7 +278,7 @@ jobs:
run: echo "A" | softwareupdate --install-rosetta || true
- name: Build project
run: |
brew install go lz4 automake autoconf libtool
brew install lz4 automake autoconf libtool
export PATH="/opt/homebrew/opt/libtool/libexec/gnubin:$PATH"
make
shell: zsh {0}
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
# Pin the version in case all the builds start to fail at the same time.
# There may not be an automatic way (e.g., dependabot) to update a specific parameter of a GitHub Action,
# so we will just update it manually whenever it makes sense (e.g., a feature that we want is added).
version: v1.53.3
version: v1.56.1
args: --fix=false --timeout=5m
- name: set GOOS env to darwin
run: |
Expand All @@ -90,7 +90,7 @@ jobs:
# Pin the version in case all the builds start to fail at the same time.
# There may not be an automatic way (e.g., dependabot) to update a specific parameter of a GitHub Action,
# so we will just update it manually whenever it makes sense (e.g., a feature that we want is added).
version: v1.53.3
version: v1.56.1
args: --fix=false --timeout=5m --skip-dirs="(^|/)deps($|/)"
shellcheck:
name: ShellCheck
Expand Down Expand Up @@ -142,6 +142,10 @@ jobs:
fetch-depth: 0
persist-credentials: false
submodules: recursive
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version-file: go.mod
cache: true
- name: Set output variables
id: vars
run: |
Expand All @@ -167,7 +171,7 @@ jobs:
fi
- name: Install Rosetta 2
run: echo "A" | softwareupdate --install-rosetta || true
- run: brew install go lz4 automake autoconf libtool
- run: brew install lz4 automake autoconf libtool
shell: zsh {0}
- name: Build project
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-homebrew.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ jobs:
run: echo "A" | softwareupdate --install-rosetta || true
- name: Build project
run: |
brew install go lz4 automake autoconf libtool
brew install lz4 automake autoconf libtool
export PATH="/opt/homebrew/opt/libtool/libexec/gnubin:$PATH"
make
shell: zsh {0}
Expand Down Expand Up @@ -220,7 +220,7 @@ jobs:
run: echo "A" | softwareupdate --install-rosetta || true
- name: Build project
run: |
brew install go lz4 automake autoconf libtool
brew install lz4 automake autoconf libtool
export PATH="/opt/homebrew/opt/libtool/libexec/gnubin:$PATH"
make
shell: zsh {0}
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/upload-build-to-S3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@ jobs:
with:
go-version-file: go.mod
cache: true

- name: Make macos aarch64 build
run: |
brew install go lz4 automake autoconf libtool
brew install lz4 automake autoconf libtool
make clean
make download-licenses
make FINCH_OS_IMAGE_LOCATION_ROOT=/Applications/Finch
Expand All @@ -55,10 +54,9 @@ jobs:
with:
go-version-file: go.mod
cache: true

- name: Make macos x86_64 build
run: |
brew install go lz4 automake autoconf libtool
brew install lz4 automake autoconf libtool
make clean
make download-licenses
make FINCH_OS_IMAGE_LOCATION_ROOT=/Applications/Finch
Expand Down
22 changes: 11 additions & 11 deletions cmd/finch/gen_docs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ func TestGenDocsAction_runAdapter(t *testing.T) {
return c
},
mockSvc: func(
ctrl *gomock.Controller,
_ *gomock.Controller,
t *testing.T,
logger *mocks.Logger,
mFs afero.Fs,
deps *mocks.GenDocsSystemDeps,
stdout *os.File,
_ *os.File,
) {
require.NoError(t, mFs.Mkdir("outDir", 0o666))
logger.EXPECT().Infof("Creating doc for command: %s", "test-command")
Expand Down Expand Up @@ -114,12 +114,12 @@ func TestGenDocsAction_runAdapter(t *testing.T) {
return c
},
mockSvc: func(
ctrl *gomock.Controller,
_ *gomock.Controller,
t *testing.T,
logger *mocks.Logger,
mFs afero.Fs,
deps *mocks.GenDocsSystemDeps,
stdout *os.File,
_ *os.File,
) {
require.NoError(t, mFs.Mkdir("outDir", 0o666))
logger.EXPECT().Infof("Creating doc for command: %s", "test-command")
Expand Down Expand Up @@ -147,16 +147,16 @@ func TestGenDocsAction_runAdapter(t *testing.T) {
return c
},
mockSvc: func(
ctrl *gomock.Controller,
t *testing.T,
logger *mocks.Logger,
mFs afero.Fs,
deps *mocks.GenDocsSystemDeps,
stdout *os.File,
_ *gomock.Controller,
_ *testing.T,
_ *mocks.Logger,
_ afero.Fs,
_ *mocks.GenDocsSystemDeps,
_ *os.File,
) {
},
want: nil,
postRunCheck: func(t *testing.T, fs afero.Fs) {
postRunCheck: func(_ *testing.T, _ afero.Fs) {
},
},
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/finch/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ var newApp = func(
// TODO: Decide when to forward --debug to the dependencies
// (e.g. nerdctl for container commands and limactl for VM commands).
rootCmd.PersistentFlags().Bool("debug", false, "running under debug mode")
rootCmd.PersistentPreRunE = func(cmd *cobra.Command, args []string) error {
rootCmd.PersistentPreRunE = func(cmd *cobra.Command, _ []string) error {
// running commands under debug mode will print out debug logs
debugMode, _ := cmd.Flags().GetBool("debug")
if debugMode {
Expand Down
8 changes: 4 additions & 4 deletions cmd/finch/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func TestXmain(t *testing.T) {
name: "happy path",
wantErr: nil,
mockSvc: func(
logger *mocks.Logger,
_ *mocks.Logger,
ffd *mocks.FinchFinderDeps,
fs afero.Fs,
loadCfgDeps *mocks.LoadSystemDeps,
Expand Down Expand Up @@ -121,11 +121,11 @@ func TestXmain(t *testing.T) {
name: "happy path",
wantErr: nil,
mockSvc: func(
logger *mocks.Logger,
_ *mocks.Logger,
ffd *mocks.FinchFinderDeps,
fs afero.Fs,
loadCfgDeps *mocks.LoadSystemDeps,
mem *mocks.Memory,
_ *mocks.LoadSystemDeps,
_ *mocks.Memory,
) {
require.NoError(t, afero.WriteFile(fs, "/home/.finch/finch.yaml", []byte(configStr), 0o600))

Expand Down
Loading

0 comments on commit 1bfe484

Please sign in to comment.