From 1d2b8d980bc4ca7a526083393ec3752a2ef78cf5 Mon Sep 17 00:00:00 2001 From: Peter Matseykanets Date: Mon, 10 Aug 2020 15:28:44 -0400 Subject: [PATCH] Use GitHub Actions (#69) --- .circleci/config.yml | 14 ---------- .github/workflows/build.yml | 53 +++++++++++++++++++++++++++++++++++++ README.md | 2 +- .codecov.yml => codecov.yml | 0 4 files changed, 54 insertions(+), 15 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/build.yml rename .codecov.yml => codecov.yml (100%) diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 684e1cd..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,14 +0,0 @@ -version: 2 -jobs: - build: - working_directory: /go/src/github.com/VividCortex/siesta - docker: - - image: circleci/golang:1.13.3 - environment: - GO111MODULE: "off" - - steps: - - checkout - - run: go vet ./... - - run: go test -race -coverprofile=coverage.txt -covermode=atomic ./... - - run: bash <(curl -s https://raw.githubusercontent.com/VividCortex/codecov-bash/master/codecov) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..55d6be8 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,53 @@ +name: build + +on: + push: + branches: + - master + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - go: 1.11.9 + build-with: false + - go: 1.13.14 + build-with: true + - go: 1.14.6 + build-with: false + continue-on-error: ${{ matrix.build-with == false }} + name: Build with ${{ matrix.go }} + defaults: + run: + working-directory: src/github.com/${{ github.repository }} + env: + GOPATH: ${{ github.workspace }} + + steps: + - name: Set up Go + uses: actions/setup-go@v1 + with: + go-version: ${{ matrix.go }} + + - name: Checkout code + uses: actions/checkout@v2 + with: + path: src/github.com/${{ github.repository }} + + - name: Vet + run: | + go vet ./... + + - name: Test + run: | + go test -vet=off -race -coverprofile=coverage.txt -covermode=atomic ./... + + - name: Upload code coverage report + if: matrix.build-with == true + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + run: bash <(curl -s https://raw.githubusercontent.com/VividCortex/codecov-bash/master/codecov) diff --git a/README.md b/README.md index cc9d8ce..675106d 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # siesta -[![CircleCI](https://circleci.com/gh/VividCortex/siesta.svg?style=svg)](https://circleci.com/gh/VividCortex/siesta) [![GoDoc](https://godoc.org/github.com/VividCortex/siesta?status.svg)](https://godoc.org/github.com/VividCortex/siesta) +![build](https://github.com/VividCortex/siesta/workflows/build/badge.svg) [![codecov](https://codecov.io/gh/VividCortex/siesta/branch/master/graph/badge.svg)](https://codecov.io/gh/VividCortex/siesta) Siesta is a framework for writing composable HTTP handlers in Go. It supports typed URL parameters, middleware chains, and context passing. diff --git a/.codecov.yml b/codecov.yml similarity index 100% rename from .codecov.yml rename to codecov.yml