2021-05-04 16:57:33 -05:00
|
|
|
name: checks
|
|
|
|
on: [pull_request, workflow_dispatch]
|
2020-02-10 17:27:05 -06:00
|
|
|
|
2021-08-30 13:06:20 -05:00
|
|
|
env:
|
2021-08-30 19:01:30 -05:00
|
|
|
ACT_OWNER: ${{ github.repository_owner }}
|
|
|
|
ACT_REPOSITORY: ${{ github.repository }}
|
2022-03-29 15:10:32 -05:00
|
|
|
GO_VERSION: 1.18
|
2021-12-22 11:29:43 -06:00
|
|
|
CGO_ENABLED: 0
|
2021-08-30 13:06:20 -05:00
|
|
|
|
2020-02-10 17:27:05 -06:00
|
|
|
jobs:
|
2020-02-24 16:43:03 -06:00
|
|
|
lint:
|
2021-05-04 16:57:33 -05:00
|
|
|
name: lint
|
2020-02-24 16:43:03 -06:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-03-14 10:14:32 -05:00
|
|
|
- uses: actions/checkout@v3
|
2021-05-03 11:52:03 -05:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2021-09-25 14:13:22 -05:00
|
|
|
- uses: actions/setup-go@v2
|
2021-03-30 14:26:25 -05:00
|
|
|
with:
|
2021-08-30 13:06:20 -05:00
|
|
|
go-version: ${{ env.GO_VERSION }}
|
2022-03-14 10:21:54 -05:00
|
|
|
- uses: golangci/golangci-lint-action@v3.1.0
|
2021-03-29 09:55:51 -05:00
|
|
|
with:
|
2021-11-12 14:48:10 -06:00
|
|
|
version: latest
|
2021-12-22 11:29:43 -06:00
|
|
|
- uses: megalinter/megalinter/flavors/go@v5
|
2021-05-03 11:52:03 -05:00
|
|
|
env:
|
|
|
|
DEFAULT_BRANCH: master
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2021-05-04 16:57:33 -05:00
|
|
|
VALIDATE_ALL_CODEBASE: false
|
2021-12-22 11:29:43 -06:00
|
|
|
GITHUB_STATUS_REPORTER: ${{ !env.ACT }}
|
|
|
|
GITHUB_COMMENT_REPORTER: ${{ !env.ACT }}
|
2020-02-24 16:43:03 -06:00
|
|
|
|
2021-05-04 16:57:33 -05:00
|
|
|
test-linux:
|
|
|
|
name: test-linux
|
2020-02-10 17:27:05 -06:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-03-14 10:14:32 -05:00
|
|
|
- uses: actions/checkout@v3
|
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
|
2021-09-25 14:13:22 -05:00
|
|
|
- uses: actions/setup-go@v2
|
2021-03-29 09:55:51 -05:00
|
|
|
with:
|
2021-08-30 13:06:20 -05:00
|
|
|
go-version: ${{ env.GO_VERSION }}
|
2022-03-28 15:05:07 -05:00
|
|
|
- uses: actions/cache@v3
|
2021-05-02 10:13:30 -05:00
|
|
|
if: ${{ !env.ACT }}
|
|
|
|
with:
|
|
|
|
path: ~/go/pkg/mod
|
|
|
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-go-
|
|
|
|
- run: go test -v -cover -coverprofile=coverage.txt -covermode=atomic ./...
|
2021-03-29 11:07:13 -05:00
|
|
|
- name: Upload Codecov report
|
2021-09-23 02:12:29 -05:00
|
|
|
uses: codecov/codecov-action@v2.1.0
|
2021-03-29 09:55:51 -05:00
|
|
|
with:
|
|
|
|
files: coverage.txt
|
|
|
|
fail_ci_if_error: true # optional (default = false)
|
|
|
|
|
2020-08-30 00:55:22 -05:00
|
|
|
snapshot:
|
2021-05-04 16:57:33 -05:00
|
|
|
name: snapshot
|
2020-08-30 00:55:22 -05:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-03-14 10:14:32 -05:00
|
|
|
- uses: actions/checkout@v3
|
2021-09-25 14:13:22 -05:00
|
|
|
- uses: actions/setup-go@v2
|
2021-03-30 14:26:25 -05:00
|
|
|
with:
|
2021-08-30 13:06:20 -05:00
|
|
|
go-version: ${{ env.GO_VERSION }}
|
2022-03-28 15:05:07 -05:00
|
|
|
- uses: actions/cache@v3
|
2021-05-02 10:13:30 -05:00
|
|
|
if: ${{ !env.ACT }}
|
|
|
|
with:
|
|
|
|
path: ~/go/pkg/mod
|
|
|
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-go-
|
2021-03-29 09:55:51 -05:00
|
|
|
- name: GoReleaser
|
|
|
|
uses: goreleaser/goreleaser-action@v2
|
|
|
|
with:
|
2021-10-24 11:36:09 -05:00
|
|
|
version: latest
|
2021-03-29 09:55:51 -05:00
|
|
|
args: release --snapshot --rm-dist
|
2021-05-23 10:32:55 -05:00
|
|
|
- name: Capture x86_64 (64-bit) Linux binary
|
|
|
|
if: ${{ !env.ACT }}
|
2021-03-29 09:55:51 -05:00
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
2021-05-23 10:32:55 -05:00
|
|
|
name: act-linux-amd64
|
2021-03-29 09:55:51 -05:00
|
|
|
path: dist/act_linux_amd64/act
|
2021-05-23 10:32:55 -05:00
|
|
|
- name: Capture i386 (32-bit) Linux binary
|
|
|
|
if: ${{ !env.ACT }}
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: act-linux-i386
|
|
|
|
path: dist/act_linux_386/act
|
|
|
|
- name: Capture arm64 (64-bit) Linux binary
|
|
|
|
if: ${{ !env.ACT }}
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: act-linux-arm64
|
|
|
|
path: dist/act_linux_arm64/act
|
|
|
|
- name: Capture armv6 (32-bit) Linux binary
|
|
|
|
if: ${{ !env.ACT }}
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: act-linux-armv6
|
|
|
|
path: dist/act_linux_arm_6/act
|
|
|
|
- name: Capture armv7 (32-bit) Linux binary
|
|
|
|
if: ${{ !env.ACT }}
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: act-linux-armv7
|
|
|
|
path: dist/act_linux_arm_7/act
|
|
|
|
- name: Capture x86_64 (64-bit) Windows binary
|
|
|
|
if: ${{ !env.ACT }}
|
2021-03-29 09:55:51 -05:00
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
2021-05-23 10:32:55 -05:00
|
|
|
name: act-windows-amd64
|
2021-03-29 09:55:51 -05:00
|
|
|
path: dist/act_windows_amd64/act.exe
|
2021-05-23 10:32:55 -05:00
|
|
|
- name: Capture i386 (32-bit) Windows binary
|
|
|
|
if: ${{ !env.ACT }}
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: act-windows-i386
|
|
|
|
path: dist/act_windows_386/act.exe
|
2021-08-30 13:06:20 -05:00
|
|
|
- name: Capture arm64 (64-bit) Windows binary
|
|
|
|
if: ${{ !env.ACT }}
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: act-windows-arm64
|
|
|
|
path: dist/act_windows_arm64/act.exe
|
2021-05-23 10:32:55 -05:00
|
|
|
- name: Capture armv7 (32-bit) Windows binary
|
|
|
|
if: ${{ !env.ACT }}
|
2021-03-29 09:55:51 -05:00
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
2021-05-23 10:32:55 -05:00
|
|
|
name: act-windows-armv7
|
|
|
|
path: dist/act_windows_arm_7/act.exe
|
|
|
|
- name: Capture x86_64 (64-bit) MacOS binary
|
|
|
|
if: ${{ !env.ACT }}
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: act-macos-amd64
|
2021-03-29 09:55:51 -05:00
|
|
|
path: dist/act_darwin_amd64/act
|
2021-05-23 10:32:55 -05:00
|
|
|
- name: Capture arm64 (64-bit) MacOS binary
|
|
|
|
if: ${{ !env.ACT }}
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: act-macos-arm64
|
|
|
|
path: dist/act_darwin_arm64/act
|
2021-12-08 12:49:33 -06:00
|
|
|
- name: Chocolatey
|
|
|
|
uses: ./.github/actions/choco
|
|
|
|
with:
|
|
|
|
version: v0.0.0-pr
|