From 25d879004093dec17baf5ef50f09f4d9c3a146ea Mon Sep 17 00:00:00 2001 From: Christian Rocha Date: Fri, 9 Jul 2021 15:02:10 -0400 Subject: [PATCH] Add GitHub workflows --- .github/workflows/build.yml | 30 ++++++++++++++++++++++++++++++ .github/workflows/lint.yml | 19 +++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..96e6b8d --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,30 @@ +name: build + +on: [push, pull_request] + +jobs: + build: + strategy: + matrix: + go-version: [~1.16, ^1] + os: [ubuntu-latest, macos-latest, windows-latest] + runs-on: ${{ matrix.os }} + env: + GO111MODULE: "on" + steps: + - name: Install Go + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + + - name: Checkout code + uses: actions/checkout@v2 + + - name: Download Go modules + run: go mod download + + - name: Build + run: go build -v ./... + + - name: Test + run: go test ./... diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..9dc4973 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,19 @@ +name: lint + +on: [push, pull_request] + +jobs: + golangci: + name: lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: golangci-lint + uses: golangci/golangci-lint-action@v2 + with: + # Optional: golangci-lint command line arguments. + args: --issues-exit-code=0 + # Optional: working directory, useful for monorepos + # working-directory: somedir + # Optional: show only new issues if it's a pull request. The default value is `false`. + only-new-issues: true