From 0814b10a16f8e53280d9e2138ae3a7b95381514a Mon Sep 17 00:00:00 2001 From: Cameron Moore Date: Mon, 28 Sep 2020 17:20:22 -0500 Subject: [PATCH 1/3] Add Github Action to build & run tests --- .github/workflows/build.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..af26c40 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,29 @@ +name: build +on: [push, pull_request] +jobs: + build: + strategy: + matrix: + go-version: [1.14.x, 1.15.x] + os: [ubuntu-latest, macos-latest, windows-latest] + + runs-on: ${{ matrix.os }} + + steps: + - name: Setup Go + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + id: go + + - name: Checkout code + uses: actions/checkout@v2 + + - name: Download dependencies + run: go mod download + + - name: Build + run: go build -v + + - name: Test + run: go test -v ./... From a904537367e0c7d36976e723f1c1a596c3498670 Mon Sep 17 00:00:00 2001 From: Cameron Moore Date: Mon, 28 Sep 2020 20:41:24 -0500 Subject: [PATCH 2/3] Add build badge to README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1706b79..35dfce9 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# What is webhook? +# What is webhook? ![build-status][badge] Webhook @@ -202,3 +202,4 @@ THE SOFTWARE. [w]: https://github.com/adnanh/webhook [wc]: https://github.com/adnanh/webhook-contrib +[badge]: https://github.com/adnanh/webhook/workflows/build/badge.svg From f007fa52809edc645cddb27ce688ce73f58aad92 Mon Sep 17 00:00:00 2001 From: Cameron Moore Date: Mon, 28 Sep 2020 20:51:09 -0500 Subject: [PATCH 3/3] Simplify build workflow --- .github/workflows/build.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index af26c40..75f347d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,18 +10,12 @@ jobs: runs-on: ${{ matrix.os }} steps: - - name: Setup Go - uses: actions/setup-go@v2 + - uses: actions/checkout@v2 + - uses: actions/setup-go@v2 with: go-version: ${{ matrix.go-version }} id: go - - name: Checkout code - uses: actions/checkout@v2 - - - name: Download dependencies - run: go mod download - - name: Build run: go build -v