2021-05-05 05:57:33 +08:00
|
|
|
name: checks
|
|
|
|
on: [pull_request, workflow_dispatch]
|
2020-02-11 07:27:05 +08:00
|
|
|
|
2023-04-24 03:18:38 +08:00
|
|
|
concurrency:
|
|
|
|
cancel-in-progress: true
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
|
2021-08-31 02:06:20 +08:00
|
|
|
env:
|
2021-08-31 08:01:30 +08:00
|
|
|
ACT_OWNER: ${{ github.repository_owner }}
|
|
|
|
ACT_REPOSITORY: ${{ github.repository }}
|
2022-03-30 04:10:32 +08:00
|
|
|
GO_VERSION: 1.18
|
2021-12-23 01:29:43 +08:00
|
|
|
CGO_ENABLED: 0
|
2021-08-31 02:06:20 +08:00
|
|
|
|
2020-02-11 07:27:05 +08:00
|
|
|
jobs:
|
2020-02-25 06:43:03 +08:00
|
|
|
lint:
|
2021-05-05 05:57:33 +08:00
|
|
|
name: lint
|
2020-02-25 06:43:03 +08:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-03-14 23:14:32 +08:00
|
|
|
- uses: actions/checkout@v3
|
2021-05-04 00:52:03 +08:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2023-03-20 11:31:00 +08:00
|
|
|
- uses: actions/setup-go@v4
|
2021-03-31 03:26:25 +08:00
|
|
|
with:
|
2021-08-31 02:06:20 +08:00
|
|
|
go-version: ${{ env.GO_VERSION }}
|
2022-04-20 03:43:30 +08:00
|
|
|
check-latest: true
|
2023-07-11 07:55:19 +08:00
|
|
|
- uses: golangci/golangci-lint-action@v3.6.0
|
2021-03-29 22:55:51 +08:00
|
|
|
with:
|
2022-08-07 06:53:05 +08:00
|
|
|
version: v1.47.2
|
2023-06-12 11:33:28 +08:00
|
|
|
- uses: megalinter/megalinter/flavors/go@v7.1.0
|
2021-05-04 00:52:03 +08:00
|
|
|
env:
|
|
|
|
DEFAULT_BRANCH: master
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2021-05-05 05:57:33 +08:00
|
|
|
VALIDATE_ALL_CODEBASE: false
|
2021-12-23 01:29:43 +08:00
|
|
|
GITHUB_STATUS_REPORTER: ${{ !env.ACT }}
|
|
|
|
GITHUB_COMMENT_REPORTER: ${{ !env.ACT }}
|
2020-02-25 06:43:03 +08:00
|
|
|
|
2021-05-05 05:57:33 +08:00
|
|
|
test-linux:
|
|
|
|
name: test-linux
|
2020-02-11 07:27:05 +08:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-03-14 23:14:32 +08:00
|
|
|
- uses: actions/checkout@v3
|
2021-03-30 00:07:13 +08:00
|
|
|
with:
|
|
|
|
fetch-depth: 2
|
2021-03-29 22:55:51 +08:00
|
|
|
- name: Set up QEMU
|
2022-05-09 11:03:00 +08:00
|
|
|
uses: docker/setup-qemu-action@v2
|
2023-03-20 11:31:00 +08:00
|
|
|
- uses: actions/setup-go@v4
|
2021-03-29 22:55:51 +08:00
|
|
|
with:
|
2021-08-31 02:06:20 +08:00
|
|
|
go-version: ${{ env.GO_VERSION }}
|
2022-04-20 03:43:30 +08:00
|
|
|
check-latest: true
|
2022-03-29 04:05:07 +08:00
|
|
|
- uses: actions/cache@v3
|
2021-05-02 23:13:30 +08:00
|
|
|
if: ${{ !env.ACT }}
|
|
|
|
with:
|
|
|
|
path: ~/go/pkg/mod
|
|
|
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-go-
|
2023-01-25 16:14:51 +08:00
|
|
|
- name: Run Tests
|
|
|
|
uses: ./.github/actions/run-tests
|
|
|
|
with:
|
|
|
|
upload-logs-name: logs-linux
|
2023-04-26 01:32:34 +08:00
|
|
|
- name: Run act from cli
|
|
|
|
run: go run main.go -P ubuntu-latest=node:16-buster-slim -C ./pkg/runner/testdata/ -W ./basic/push.yml
|
2021-03-30 00:07:13 +08:00
|
|
|
- name: Upload Codecov report
|
2023-05-22 11:12:14 +08:00
|
|
|
uses: codecov/codecov-action@v3.1.4
|
2021-03-29 22:55:51 +08:00
|
|
|
with:
|
|
|
|
files: coverage.txt
|
|
|
|
fail_ci_if_error: true # optional (default = false)
|
|
|
|
|
2022-11-17 05:29:45 +08:00
|
|
|
test-host:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os:
|
|
|
|
- windows-latest
|
|
|
|
- macos-latest
|
|
|
|
name: test-${{matrix.os}}
|
|
|
|
runs-on: ${{matrix.os}}
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
fetch-depth: 2
|
2023-03-20 11:31:00 +08:00
|
|
|
- uses: actions/setup-go@v4
|
2022-11-17 05:29:45 +08:00
|
|
|
with:
|
|
|
|
go-version: ${{ env.GO_VERSION }}
|
|
|
|
check-latest: true
|
2023-01-25 16:14:51 +08:00
|
|
|
- name: Run Tests
|
|
|
|
uses: ./.github/actions/run-tests
|
|
|
|
with:
|
|
|
|
filter: '^TestRunEventHostEnvironment$'
|
|
|
|
upload-logs-name: logs-${{ matrix.os }}
|
2022-11-17 05:29:45 +08:00
|
|
|
|
2020-08-30 13:55:22 +08:00
|
|
|
snapshot:
|
2021-05-05 05:57:33 +08:00
|
|
|
name: snapshot
|
2020-08-30 13:55:22 +08:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-03-14 23:14:32 +08:00
|
|
|
- uses: actions/checkout@v3
|
2023-03-20 11:31:00 +08:00
|
|
|
- uses: actions/setup-go@v4
|
2021-03-31 03:26:25 +08:00
|
|
|
with:
|
2021-08-31 02:06:20 +08:00
|
|
|
go-version: ${{ env.GO_VERSION }}
|
2022-04-20 03:43:30 +08:00
|
|
|
check-latest: true
|
2022-03-29 04:05:07 +08:00
|
|
|
- uses: actions/cache@v3
|
2021-05-02 23:13:30 +08:00
|
|
|
if: ${{ !env.ACT }}
|
|
|
|
with:
|
|
|
|
path: ~/go/pkg/mod
|
|
|
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-go-
|
2021-03-29 22:55:51 +08:00
|
|
|
- name: GoReleaser
|
2022-12-19 23:46:21 +08:00
|
|
|
uses: goreleaser/goreleaser-action@v4
|
2021-03-29 22:55:51 +08:00
|
|
|
with:
|
2021-10-25 00:36:09 +08:00
|
|
|
version: latest
|
2023-07-11 01:15:16 +08:00
|
|
|
args: release --snapshot --clean
|
2021-05-23 23:32:55 +08:00
|
|
|
- name: Capture x86_64 (64-bit) Linux binary
|
|
|
|
if: ${{ !env.ACT }}
|
2022-04-11 10:38:04 +08:00
|
|
|
uses: actions/upload-artifact@v3
|
2021-03-29 22:55:51 +08:00
|
|
|
with:
|
2021-05-23 23:32:55 +08:00
|
|
|
name: act-linux-amd64
|
2022-04-20 03:27:37 +08:00
|
|
|
path: dist/act_linux_amd64_v1/act
|
2021-05-23 23:32:55 +08:00
|
|
|
- name: Capture i386 (32-bit) Linux binary
|
|
|
|
if: ${{ !env.ACT }}
|
2022-04-11 10:38:04 +08:00
|
|
|
uses: actions/upload-artifact@v3
|
2021-05-23 23:32:55 +08:00
|
|
|
with:
|
|
|
|
name: act-linux-i386
|
|
|
|
path: dist/act_linux_386/act
|
|
|
|
- name: Capture arm64 (64-bit) Linux binary
|
|
|
|
if: ${{ !env.ACT }}
|
2022-04-11 10:38:04 +08:00
|
|
|
uses: actions/upload-artifact@v3
|
2021-05-23 23:32:55 +08:00
|
|
|
with:
|
|
|
|
name: act-linux-arm64
|
|
|
|
path: dist/act_linux_arm64/act
|
|
|
|
- name: Capture armv6 (32-bit) Linux binary
|
|
|
|
if: ${{ !env.ACT }}
|
2022-04-11 10:38:04 +08:00
|
|
|
uses: actions/upload-artifact@v3
|
2021-05-23 23:32:55 +08:00
|
|
|
with:
|
|
|
|
name: act-linux-armv6
|
|
|
|
path: dist/act_linux_arm_6/act
|
|
|
|
- name: Capture armv7 (32-bit) Linux binary
|
|
|
|
if: ${{ !env.ACT }}
|
2022-04-11 10:38:04 +08:00
|
|
|
uses: actions/upload-artifact@v3
|
2021-05-23 23:32:55 +08:00
|
|
|
with:
|
|
|
|
name: act-linux-armv7
|
|
|
|
path: dist/act_linux_arm_7/act
|
|
|
|
- name: Capture x86_64 (64-bit) Windows binary
|
|
|
|
if: ${{ !env.ACT }}
|
2022-04-11 10:38:04 +08:00
|
|
|
uses: actions/upload-artifact@v3
|
2021-03-29 22:55:51 +08:00
|
|
|
with:
|
2021-05-23 23:32:55 +08:00
|
|
|
name: act-windows-amd64
|
2022-04-20 03:27:37 +08:00
|
|
|
path: dist/act_windows_amd64_v1/act.exe
|
2021-05-23 23:32:55 +08:00
|
|
|
- name: Capture i386 (32-bit) Windows binary
|
|
|
|
if: ${{ !env.ACT }}
|
2022-04-11 10:38:04 +08:00
|
|
|
uses: actions/upload-artifact@v3
|
2021-05-23 23:32:55 +08:00
|
|
|
with:
|
|
|
|
name: act-windows-i386
|
|
|
|
path: dist/act_windows_386/act.exe
|
2021-08-31 02:06:20 +08:00
|
|
|
- name: Capture arm64 (64-bit) Windows binary
|
|
|
|
if: ${{ !env.ACT }}
|
2022-04-11 10:38:04 +08:00
|
|
|
uses: actions/upload-artifact@v3
|
2021-08-31 02:06:20 +08:00
|
|
|
with:
|
|
|
|
name: act-windows-arm64
|
|
|
|
path: dist/act_windows_arm64/act.exe
|
2021-05-23 23:32:55 +08:00
|
|
|
- name: Capture armv7 (32-bit) Windows binary
|
|
|
|
if: ${{ !env.ACT }}
|
2022-04-11 10:38:04 +08:00
|
|
|
uses: actions/upload-artifact@v3
|
2021-03-29 22:55:51 +08:00
|
|
|
with:
|
2021-05-23 23:32:55 +08:00
|
|
|
name: act-windows-armv7
|
|
|
|
path: dist/act_windows_arm_7/act.exe
|
|
|
|
- name: Capture x86_64 (64-bit) MacOS binary
|
|
|
|
if: ${{ !env.ACT }}
|
2022-04-11 10:38:04 +08:00
|
|
|
uses: actions/upload-artifact@v3
|
2021-05-23 23:32:55 +08:00
|
|
|
with:
|
|
|
|
name: act-macos-amd64
|
2022-04-20 03:27:37 +08:00
|
|
|
path: dist/act_darwin_amd64_v1/act
|
2021-05-23 23:32:55 +08:00
|
|
|
- name: Capture arm64 (64-bit) MacOS binary
|
|
|
|
if: ${{ !env.ACT }}
|
2022-04-11 10:38:04 +08:00
|
|
|
uses: actions/upload-artifact@v3
|
2021-05-23 23:32:55 +08:00
|
|
|
with:
|
|
|
|
name: act-macos-arm64
|
|
|
|
path: dist/act_darwin_arm64/act
|
2021-12-09 02:49:33 +08:00
|
|
|
- name: Chocolatey
|
|
|
|
uses: ./.github/actions/choco
|
|
|
|
with:
|
|
|
|
version: v0.0.0-pr
|