diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..d8a3d2a --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,36 @@ +name: Lint + +on: + - push + - pull_request + +env: + CGO_LDFLAGS_ALLOW: "-s|-w" + +jobs: + lint: + runs-on: ubuntu-latest + strategy: + matrix: + go-version: ["1.18.x"] + steps: + - name: Checkout + uses: actions/checkout@v2 + - uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + - name: Cache mods + uses: actions/cache@v3 + with: + path: | + ~/.cache/go-build + ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + - name: Download mods + run: go mod download + - name: Lint + uses: golangci/golangci-lint-action@v3 + with: + version: v1.45.2 + args: --timeout 2m0s + skip-cache: true diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..bcd4f25 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,33 @@ +name: Test + +on: + - push + - pull_request + +env: + CGO_LDFLAGS_ALLOW: "-s|-w" + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + go-version: ["1.18.x", "1.17.x", "1.16.x"] + steps: + - name: Checkout + uses: actions/checkout@v2 + - uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + - name: Cache mods + uses: actions/cache@v3 + with: + path: | + ~/.cache/go-build + ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + - name: Download mods + run: go mod download + - name: Test + run: go test ./... +