Skip to content

Commit

Permalink
chore: adds support for Go 1.22 and 1.23
Browse files Browse the repository at this point in the history
  • Loading branch information
Justintime50 committed Aug 22, 2024
1 parent 6d18dae commit 566a52e
Show file tree
Hide file tree
Showing 9 changed files with 66 additions and 184 deletions.
61 changes: 25 additions & 36 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,39 @@ name: build
on: [push, pull_request]

jobs:
shellcheck:
name: Shellcheck
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@1.0.0
with:
scandir: 'legacy'
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
- name: Run Golangci Linter
uses: golangci/golangci-lint-action@v2
uses: golangci/golangci-lint-action@v6
with:
version: v1.60.1
test:
name: Test with Coverage
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
go: ['1.16', '1.17', '1.18', '1.19', '1.20', '1.21', '1.22', '1.23']
steps:
- uses: actions/checkout@v4
- uses: extractions/setup-just@v2
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- name: Build and test
run: just build test
coverage:
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v5
- uses: actions/checkout@v4
- uses: extractions/setup-just@v2
- uses: actions/setup-go@v5
with:
go-version: '1.21'
- name: Checkout Repository
uses: actions/checkout@v4
- name: Run unit tests
run: make coverage
go-version: '1.23'
- name: Generate coverage report
run: just coverage
- name: Install goveralls
if: github.ref == 'refs/heads/main'
env:
Expand All @@ -42,18 +46,3 @@ jobs:
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: goveralls -coverprofile=covprofile -service=github
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
go: ['1.16', '1.17', '1.18', '1.19', '1.20', '1.21']
steps:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- name: Checkout Repository
uses: actions/checkout@v4
- name: Build
run: go build -o dist/alchemist
8 changes: 3 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@ jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.21'
go-version: '1.23'
- name: Run goreleaser
uses: goreleaser/goreleaser-action@v2
with:
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## v3.3.0 (2024-08-22)

- Adds support for Go `1.22` and `1.23`

## v3.2.0 (2022-05-21)

- Adds a `--greedy` CLI flag so casks can be updated even if they have a UI "auto-update" feature (helps keep Homebrew app versions synced better with what they actually are)
Expand Down
34 changes: 0 additions & 34 deletions Makefile

This file was deleted.

23 changes: 4 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Alchemist saves logs to `~/alchemist/update/alchemist-update.log`. Logs by defau

Scripts generated from the backup functionality of Alchemist live at `~/alchemist/backup`. Simply run `brew bundle --file path/to/Brewfile` or `path/to/restore-choco-packages.bat` to restore your packages.

```
```text
Usage:
alchemist --update
Expand All @@ -88,22 +88,7 @@ Options:

## Development

```bash
# Build the project
make build

# Install the project globally from source
make install

# Clean the executables
make clean

# Test the project
make test

## Get test coverage
make coverage

# Lint the project (requires golangci-lint be installed)
make lint
```shell
# Get a comprehensive list of development tools
just --list
```
29 changes: 29 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
PROJECT_NAME := "alchemist"
GO_BIN := `go env GOPATH` / "bin"
DIST_PATH := "dist"

# Build the project
build:
go build -o {{DIST_PATH}}/{{PROJECT_NAME}}

# Clean the project
clean:
rm -rf vendor
rm {{DIST_PATH}}

# Get test coverage and open it in a browser
coverage:
go clean -testcache && go test ./... -coverprofile=covprofile && go tool cover -html=covprofile

# Install globally from source
install:
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b {{GO_BIN}} v1.60.1
go mod vendor

# Lint the project
lint:
{{GO_BIN}}/golangci-lint run

# Test the project
test:
go clean -testcache && go test ./...
54 changes: 0 additions & 54 deletions legacy/brew-backup.sh

This file was deleted.

35 changes: 0 additions & 35 deletions legacy/brew-update.sh

This file was deleted.

2 changes: 1 addition & 1 deletion src/general/general.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func RunCommand(cmdContext mockcmd.ExecContext, command string, args []string) (
cmd.Stderr = &stderr
err := cmd.Run()
if err != nil {
return nil, fmt.Errorf(fmt.Sprint(err) + ": " + stderr.String())
return nil, fmt.Errorf("%v: %s", err, stderr.String())
}

return &out, nil
Expand Down

0 comments on commit 566a52e

Please sign in to comment.