From dfb90f5ff8e95b05bf8fcb429b4f1b34c37e1e07 Mon Sep 17 00:00:00 2001 From: shunsuke maeda Date: Sat, 7 Sep 2019 00:16:27 +0900 Subject: [PATCH] Migrate GitHub Actions --- .github/main.workflow | 56 -------------------------------------- .github/workflows/push.yml | 39 ++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 56 deletions(-) delete mode 100644 .github/main.workflow create mode 100644 .github/workflows/push.yml diff --git a/.github/main.workflow b/.github/main.workflow deleted file mode 100644 index 44db9e0e..00000000 --- a/.github/main.workflow +++ /dev/null @@ -1,56 +0,0 @@ -workflow "main workflow" { - on = "push" - resolves = ["test", "check modified"] -} - -action "lint" { - uses = "docker://golangci/golangci-lint:latest" - runs = ["golangci-lint", "run"] - args = [ - "--disable-all", - "--enable=gofmt", - "--enable=vet", - "--enable=gocyclo", - "--enable=golint", - "--enable=ineffassign", - "--enable=misspell", - "--deadline=5m" - ] -} - -action "download" { - uses = "docker://golang:1.12" - needs = ["lint"] - env = { - GOPATH = "/github/workspace/.go" - } - runs = "go" - args = ["mod", "download"] -} - -action "test" { - uses = "docker://golang:1.12" - needs = ["download"] - env = { - GOPATH = "/github/workspace/.go" - } - runs = "go" - args = ["test", "./..."] -} - -action "tidy" { - uses = "docker://golang:1.12" - needs = ["download"] - env = { - GOPATH = "/github/workspace/.go" - } - runs = "go" - args = ["mod", "tidy"] -} - -action "check modified" { - uses = "docker://alpine/git:latest" - needs = ["tidy"] - runs = "sh" - args = ["-c", "! git status | grep modified"] -} diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml new file mode 100644 index 00000000..6965b207 --- /dev/null +++ b/.github/workflows/push.yml @@ -0,0 +1,39 @@ +on: push +name: main workflow +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: lint + uses: docker://golangci/golangci-lint:latest + with: + entrypoint: golangci-lint + args: run --disable-all --enable=gofmt --enable=vet --enable=gocyclo --enable=golint + --enable=ineffassign --enable=misspell --deadline=5m + - name: tidy + uses: docker://golang:1.12 + env: + GOPATH: /github/workspace/.go + with: + entrypoint: go + args: mod tidy + - name: download + uses: docker://golang:1.12 + env: + GOPATH: /github/workspace/.go + with: + entrypoint: go + args: mod download + - name: check modified + uses: docker://alpine/git:latest + with: + entrypoint: sh + args: -c "! git status | grep modified" + - name: test + uses: docker://golang:1.12 + env: + GOPATH: /github/workspace/.go + with: + entrypoint: go + args: test ./...