From 7dbdd8cc7675011f5d72e1edb9fef532a03a7790 Mon Sep 17 00:00:00 2001 From: akita714 Date: Tue, 11 Oct 2022 14:44:32 +0900 Subject: [PATCH 1/7] add actions settings --- .github/workflows/ci.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..4800db0 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,34 @@ +name: CI + +on: + push: + branches: [ master ] + tags-ignore: [ "**" ] + paths-ignore: [ "**.md"] + pull_request: + types: [opened, synchronize] + paths-ignore: [ "**.md" ] + +jobs: + test: + name: Test + runs-on: ubuntu-latest + steps: + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: ~1.12 + - name: Check out + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Get dependencies + run: go mod download + + - name: Lint + run : make lint + - name: Build + run: make install e2e + - name: Test + run: make test coverage + From 4d34efbd3547a6b605344b0bdcc2738d239b75a7 Mon Sep 17 00:00:00 2001 From: akita714 Date: Tue, 11 Oct 2022 15:56:27 +0900 Subject: [PATCH 2/7] skip lint --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4800db0..00f943f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,8 +25,8 @@ jobs: - name: Get dependencies run: go mod download - - name: Lint - run : make lint + # - name: Lint + # run : make lint - name: Build run: make install e2e - name: Test From 02f060ab2ea90810386a4787fb0a864237a28056 Mon Sep 17 00:00:00 2001 From: akita714 Date: Tue, 11 Oct 2022 16:02:53 +0900 Subject: [PATCH 3/7] lint with golang cli --- .github/workflows/ci.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 00f943f..7a2aabf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,9 +24,11 @@ jobs: fetch-depth: 0 - name: Get dependencies run: go mod download - - # - name: Lint - # run : make lint + - name: golangci-lint + uses: golangci/golangci-lint-action@v3 + with: + version: v1.29 + run: make lint - name: Build run: make install e2e - name: Test From db842a346d4508b4ff521d2b454d48cd0a4e215c Mon Sep 17 00:00:00 2001 From: akita714 Date: Tue, 11 Oct 2022 16:05:22 +0900 Subject: [PATCH 4/7] use config --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7a2aabf..05a42f7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,7 +28,7 @@ jobs: uses: golangci/golangci-lint-action@v3 with: version: v1.29 - run: make lint + args: --config golangci.yml - name: Build run: make install e2e - name: Test From d749f27b62af279c3d8ca4c68976b4eaa5853fa2 Mon Sep 17 00:00:00 2001 From: akita714 Date: Tue, 11 Oct 2022 16:06:36 +0900 Subject: [PATCH 5/7] delete .travis.yml --- .travis.yml | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 229aa86..0000000 --- a/.travis.yml +++ /dev/null @@ -1,22 +0,0 @@ -language: go -go: -- "1.11.x" -- "1.12.x" - -go_import_path: github.com/pfnet-research/git-ghost - -env: -- GO111MODULE=on - -install: -- go install github.com/golangci/golangci-lint/cmd/golangci-lint -- go install github.com/mattn/goveralls - -before_script: make lint - -script: -- make test coverage -- make install e2e - -after_success: -- goveralls -coverprofile=profile.cov -service=travis-ci From 3d1a6030179dd3750f7da8403d9bef08e7938289 Mon Sep 17 00:00:00 2001 From: akita714 Date: Tue, 11 Oct 2022 16:08:05 +0900 Subject: [PATCH 6/7] rm space --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 05a42f7..aaa7d08 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,4 +33,3 @@ jobs: run: make install e2e - name: Test run: make test coverage - From a6b1b5b020575f5e44464202474a6e81862bda6f Mon Sep 17 00:00:00 2001 From: akita714 Date: Tue, 11 Oct 2022 16:11:09 +0900 Subject: [PATCH 7/7] rm unnecessary sprintf --- pkg/ghost/types/branchspec.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkg/ghost/types/branchspec.go b/pkg/ghost/types/branchspec.go index 37c9502..81dee92 100644 --- a/pkg/ghost/types/branchspec.go +++ b/pkg/ghost/types/branchspec.go @@ -15,7 +15,6 @@ package types import ( - "fmt" "io/ioutil" "os" "path/filepath" @@ -150,7 +149,7 @@ func (bs CommitsBranchSpec) CreateBranch(we WorkingEnv) (GhostBranch, errors.Git if ggerr != nil { return nil, ggerr } - ggerr = git.CommitFile(dstDir, branch.FileName(), fmt.Sprintf("Create ghost commit")) + ggerr = git.CommitFile(dstDir, branch.FileName(), "Create ghost commit") if ggerr != nil { return nil, ggerr } @@ -263,7 +262,7 @@ func (bs DiffBranchSpec) CreateBranch(we WorkingEnv) (GhostBranch, errors.GitGho if err != nil { return nil, errors.WithStack(err) } - err = git.CommitFile(dstDir, branch.FileName(), fmt.Sprintf("Create ghost commit")) + err = git.CommitFile(dstDir, branch.FileName(), "Create ghost commit") if err != nil { return nil, errors.WithStack(err) }