Skip to content

Commit

Permalink
Merge pull request #90 from nikhilesh-parupalli/client-update
Browse files Browse the repository at this point in the history
Build client with go 1.16 to run on M1 macs and support Monterey. Move CI from Travis to GHA.
  • Loading branch information
harshalbhatia authored Mar 30, 2022
2 parents 36f70c6 + 43f02a2 commit 5e98044
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 17 deletions.
17 changes: 12 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,24 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.12
go-version: 1.16

- name: Test
run: make db.setup test-with-race

release:
runs-on: ubuntu-latest

if: ${{ startsWith(github.ref, 'refs/tags/') }}
steps:
- name: Release
uses: actions/checkout@v2
- uses: actions/checkout@v2

- run: ./scripts/release.sh
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16

- name: Release
run: ./scripts/release.sh
env:
GITHUB_TOKEN: ${{ secrets.HOMEBREW_REPO_PAT }}

3 changes: 2 additions & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# This is an example goreleaser.yaml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com
builds:
- env:
- main: ./exec/cli/cli.go
env:
- CGO_ENABLED=0
archives:
-
Expand Down
8 changes: 4 additions & 4 deletions daemon/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func (s *ClientTestSuite) TestListProcsReturnClientSideTimeoutError() {

procList, err := s.testClient.ListProcs()

assert.Equal(t, errors.New("Connection Timeout!!!\nGet http://proctor.example.com/jobs/metadata: Unable to reach http://proctor.example.com/\nPlease check your Internet/VPN connection for connectivity to ProctorD."), err)
assert.Equal(t, errors.New("Connection Timeout!!!\nGet \"http://proctor.example.com/jobs/metadata\": Unable to reach http://proctor.example.com/\nPlease check your Internet/VPN connection for connectivity to ProctorD."), err)
assert.Equal(t, []proc_metadata.Metadata{}, procList)
s.mockConfigLoader.AssertExpectations(t)
}
Expand Down Expand Up @@ -190,7 +190,7 @@ func (s *ClientTestSuite) TestListProcsReturnClientSideConnectionError() {

procList, err := s.testClient.ListProcs()

assert.Equal(t, errors.New("Network Error!!!\nGet http://proctor.example.com/jobs/metadata: Unknown Error"), err)
assert.Equal(t, errors.New("Network Error!!!\nGet \"http://proctor.example.com/jobs/metadata\": Unknown Error"), err)
assert.Equal(t, []proc_metadata.Metadata{}, procList)
s.mockConfigLoader.AssertExpectations(t)
}
Expand Down Expand Up @@ -501,7 +501,7 @@ func (s *ClientTestSuite) TestExecuteProcsReturnClientSideConnectionError() {
response, err := s.testClient.ExecuteProc("run-sample", map[string]string{"SAMPLE_ARG1": "sample-value"})

assert.Equal(t, "", response)
assert.Equal(t, errors.New("Network Error!!!\nPost http://proctor.example.com/jobs/execute: Unknown Error"), err)
assert.Equal(t, errors.New("Network Error!!!\nPost \"http://proctor.example.com/jobs/execute\": Unknown Error"), err)
s.mockConfigLoader.AssertExpectations(t)
}

Expand Down Expand Up @@ -667,7 +667,7 @@ func (s *ClientTestSuite) TestGetDefinitiveProcExecutionStatusForHTTPRequestFail

procExecutionStatus, err := s.testClient.GetDefinitiveProcExecutionStatus("some-proc-name")

assert.Equal(t, errors.New("Connection Timeout!!!\nGet http://proctor.example.com/jobs/execute/some-proc-name/status: Unable to reach http://proctor.example.com/\nPlease check your Internet/VPN connection for connectivity to ProctorD."), err)
assert.Equal(t, errors.New("Connection Timeout!!!\nGet \"http://proctor.example.com/jobs/execute/some-proc-name/status\": Unable to reach http://proctor.example.com/\nPlease check your Internet/VPN connection for connectivity to ProctorD."), err)
s.mockConfigLoader.AssertExpectations(t)
assert.Equal(t, "", procExecutionStatus)
}
Expand Down
2 changes: 0 additions & 2 deletions scripts/proctor.rb.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ class Proctor < Formula
sha256 "{{ .SHA }}"
head "https://github.com/gojek/proctor.git"

bottle :unneeded

def install
bin.install "proctor"
end
Expand Down
12 changes: 7 additions & 5 deletions scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ curl -sL https://git.io/goreleaser | bash
SHA=$(cat dist/checksums.txt | grep Darwin_x86_64 | awk '{ print $1}')
echo " REF_NAME => $GITHUB_REF_NAME"
go run scripts/proctor_template.go "$GITHUB_REF_NAME" "$SHA"
rm -rf homebrew-gojek
git clone "https://$GITHUB_TOKEN:@github.com/gojek/homebrew-gojek.git"
cp scripts/proctor.rb homebrew-gojek/Formula/proctor.rb
cd homebrew-gojek
rm -rf homebrew-tap
git clone "https://$GITHUB_TOKEN:@github.com/gojek/homebrew-tap.git"
cp scripts/proctor.rb homebrew-tap/Formula/proctor.rb
cd homebrew-tap
git config user.name "Github Actions"
git config user.email "<>"
git add .
git commit -m "[GH Actions] updating brew formula for release $GITHUB_REF_NAME"
#git push --force --quiet "https://$GITHUB_TOKEN:@github.com/gojektech/homebrew-gojek.git"
git push --force --quiet "https://$GITHUB_TOKEN:@github.com/gojektech/homebrew-tap.git"

0 comments on commit 5e98044

Please sign in to comment.