Skip to content

Commit

Permalink
Merge pull request #1 from smlx/fix-ci
Browse files Browse the repository at this point in the history
Fix CI/CD
  • Loading branch information
smlx authored Jul 19, 2021
2 parents 42c4c7b + fafb719 commit 790897d
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ jobs:
- name: Calculate coverage
run: go test -v -covermode=count -coverprofile=coverage.out
- name: Convert coverage to lcov
uses: jandelgado/gcov2lcov-action@v1
uses: jandelgado/gcov2lcov-action@v1.0.8
- name: Coveralls
uses: coverallsapp/github-action@1
uses: coverallsapp/github-action@1.1.3
with:
github-token: ${{ secrets.github_token }}
path-to-lcov: coverage.lcov
4 changes: 2 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2.3.4
uses: actions/checkout@v2
- name: Configure git
run: |
git config --global user.name "$GITHUB_ACTOR"
Expand All @@ -16,4 +16,4 @@ jobs:
with:
go-version: "^1.16"
- name: Run tests
run: go test -v .
run: go test -v ./...
3 changes: 2 additions & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
builds:
- env:
- main: ./cmd/jiratime
env:
- CGO_ENABLED=0
2 changes: 1 addition & 1 deletion cmd/jiratime/authorize.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func startRedirectServer(ctx context.Context, state string, c chan<- string) {
w.WriteHeader(http.StatusBadRequest)
}
c <- r.FormValue("code")
w.Write([]byte("Authorization successful. You may now close this page."))
_, _ = w.Write([]byte("Authorization successful. You may now close this page."))
})
s := &http.Server{
Addr: ":8080",
Expand Down
1 change: 1 addition & 0 deletions cmd/jiratime/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ var (
type CLI struct {
Submit SubmitCmd `kong:"cmd,default=1,help='(default) Submit times'"`
Authorize AuthorizeCmd `kong:"cmd,aliases='auth',help='Get OAuth2 client token'"`
Version VersionCmd `kong:"cmd,help='Print version information'"`
}

// getContext starts a goroutine to handle ^C gracefully, and returns a
Expand Down
12 changes: 12 additions & 0 deletions cmd/jiratime/version.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package main

import "fmt"

// VersionCmd represents the `version` command.
type VersionCmd struct{}

// Run the Version command.
func (*VersionCmd) Run() error {
fmt.Printf("jiratime version %s compiled on %s\n", version, date)
return nil
}

0 comments on commit 790897d

Please sign in to comment.