2020-02-10 17:27:05 -06:00
|
|
|
name: push
|
2020-03-02 10:04:30 -06:00
|
|
|
on: [push, pull_request]
|
2020-02-10 17:27:05 -06:00
|
|
|
|
|
|
|
jobs:
|
2020-02-24 16:43:03 -06:00
|
|
|
lint:
|
2020-10-12 12:26:22 -05:00
|
|
|
name: Lint
|
2020-02-24 16:43:03 -06:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2021-03-29 09:55:51 -05:00
|
|
|
- uses: actions/checkout@v2
|
2021-03-30 14:26:25 -05:00
|
|
|
- uses: actions/setup-go@v1
|
|
|
|
with:
|
|
|
|
go-version: 1.16
|
2021-03-29 09:55:51 -05:00
|
|
|
- uses: golangci/golangci-lint-action@v2
|
|
|
|
env:
|
|
|
|
CGO_ENABLED: 0
|
|
|
|
with:
|
|
|
|
version: v1.32.2
|
2020-02-24 16:43:03 -06:00
|
|
|
|
|
|
|
test:
|
2021-03-29 09:55:51 -05:00
|
|
|
name: Test on Linux
|
2020-02-10 17:27:05 -06:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2021-03-29 09:55:51 -05:00
|
|
|
- uses: actions/checkout@v2
|
2021-03-29 11:07:13 -05:00
|
|
|
with:
|
|
|
|
fetch-depth: 2
|
2021-03-29 09:55:51 -05:00
|
|
|
- name: Set up QEMU
|
|
|
|
uses: docker/setup-qemu-action@v1
|
|
|
|
- uses: actions/setup-go@v1
|
|
|
|
with:
|
2021-03-30 14:26:25 -05:00
|
|
|
go-version: 1.16
|
2021-03-29 09:55:51 -05:00
|
|
|
- run: go test -cover -coverprofile=coverage.txt -covermode=atomic ./...
|
|
|
|
env:
|
|
|
|
CGO_ENABLED: 0
|
2021-03-29 11:07:13 -05:00
|
|
|
- name: Upload Codecov report
|
|
|
|
uses: codecov/codecov-action@v1.3.1
|
2021-03-29 09:55:51 -05:00
|
|
|
with:
|
|
|
|
files: coverage.txt
|
|
|
|
fail_ci_if_error: true # optional (default = false)
|
|
|
|
|
|
|
|
test-macos:
|
|
|
|
name: Test on MacOS
|
|
|
|
runs-on: macos-latest
|
|
|
|
continue-on-error: true # Don't let macos test fail whole workflow
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/setup-go@v1
|
|
|
|
with:
|
2021-03-30 14:26:25 -05:00
|
|
|
go-version: 1.16
|
2021-03-29 09:55:51 -05:00
|
|
|
- name: Install MacOS Docker
|
|
|
|
uses: docker-practice/actions-setup-docker@master
|
|
|
|
- run: go test -v -timeout 1h -cover ./...
|
|
|
|
env:
|
2021-03-29 00:02:11 -05:00
|
|
|
CGO_ENABLED: 0
|
2020-02-24 17:04:33 -06:00
|
|
|
|
2020-08-30 00:55:22 -05:00
|
|
|
snapshot:
|
2020-10-12 12:26:22 -05:00
|
|
|
name: Snapshot
|
2020-08-30 00:55:22 -05:00
|
|
|
if: ${{ github.event_name == 'pull_request' }}
|
|
|
|
needs:
|
2021-03-29 09:55:51 -05:00
|
|
|
- lint
|
|
|
|
- test
|
2020-08-30 00:55:22 -05:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2021-03-29 09:55:51 -05:00
|
|
|
- uses: actions/checkout@v2
|
2021-03-30 14:26:25 -05:00
|
|
|
- uses: actions/setup-go@v1
|
|
|
|
with:
|
|
|
|
go-version: 1.16
|
2021-03-29 09:55:51 -05:00
|
|
|
- name: GoReleaser
|
|
|
|
uses: goreleaser/goreleaser-action@v2
|
|
|
|
with:
|
|
|
|
version: latest
|
|
|
|
args: release --snapshot --rm-dist
|
|
|
|
- name: Capture Linux Binary
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: act-linux
|
|
|
|
path: dist/act_linux_amd64/act
|
|
|
|
- name: Capture Windows Binary
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: act-windows
|
|
|
|
path: dist/act_windows_amd64/act.exe
|
|
|
|
- name: Capture MacOS Binary
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: act-macos
|
|
|
|
path: dist/act_darwin_amd64/act
|
2020-08-30 00:55:22 -05:00
|
|
|
|
2020-02-24 17:04:33 -06:00
|
|
|
release:
|
2020-10-12 12:26:22 -05:00
|
|
|
name: Release
|
2020-02-24 17:05:41 -06:00
|
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
2020-03-06 16:21:24 -06:00
|
|
|
needs:
|
2021-03-29 09:55:51 -05:00
|
|
|
- lint
|
|
|
|
- test
|
2020-02-24 17:04:33 -06:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2021-03-29 09:55:51 -05:00
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2021-03-30 14:26:25 -05:00
|
|
|
- uses: actions/setup-go@v1
|
|
|
|
with:
|
|
|
|
go-version: 1.16
|
2021-03-29 09:55:51 -05:00
|
|
|
- name: GoReleaser
|
|
|
|
uses: goreleaser/goreleaser-action@v1
|
|
|
|
with:
|
|
|
|
version: latest
|
|
|
|
args: release --rm-dist
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }}
|
|
|
|
- name: Chocolatey
|
|
|
|
uses: ./.github/actions/choco
|
|
|
|
with:
|
|
|
|
version: ${{ github.ref }}
|
|
|
|
apiKey: ${{ secrets.CHOCO_APIKEY }}
|