Skip to content

Commit

Permalink
Add CI check to make sure River CLI is installable
Browse files Browse the repository at this point in the history
Pertaining to the problem described in #35, seems like a good idea to
have a CI check make sure that nothing we've done with Go modules has
made the CLI not installable.
  • Loading branch information
brandur committed Nov 19, 2023
1 parent eb228bb commit dd81646
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,67 @@ jobs:
- name: river migrate-down
run: ./river migrate-down --database-url $DATABASE_URL --max-steps 100

cli_installable:
runs-on: ubuntu-latest
timeout-minutes: 3

steps:
- uses: actions/setup-go@v4
with:
go-version: "stable"
check-latest: true

#
# For Go Module
#

- name: Make Go Module directory
run: mkdir go_module

- name: Initialize Go module
run: go mod init github.com/riverqueue/rivertest
working-directory: go_module

- name: Add River as dependency
run: go get github.com/riverqueue/river@${GITHUB_REF#refs/heads/}
working-directory: go_module

- name: Add River as dependency
run: go get github.com/riverqueue/river@${GITHUB_REF#refs/heads/}
working-directory: go_module

# To make sure that `go mod tidy` below doesn't blow away the River dep.
- name: Add simple Go file
run: |
cat << EOF > main.go
package main
import "github.com/riverqueue/river"
func main() {
_ = river.NewWorkers()
}
EOF
- name: Tidy
run: go mod tidy
working-directory: go_module

- name: Install in Go module
run: go install github.com/riverqueue/river/cmd/river
working-directory: go_module

#
# For _not_Go Module
#

- name: Make not Go Module directory
run: mkdir not_go_module

- name: Install in _not_ Go module (with ref)
run: go install github.com/riverqueue/river/cmd/river@${GITHUB_REF#refs/heads/}
working-directory: not_go_module

golangci:
name: lint
runs-on: ubuntu-latest
Expand Down

0 comments on commit dd81646

Please sign in to comment.