Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speed Up Github Action #260

Merged
merged 9 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 31 additions & 9 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ on:
- 'package.json'
- 'package-lock.json'

# concurrency:
# group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
# cancel-in-progress: true
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build:
test:
strategy:
matrix:
platform: [ ubuntu-latest, windows-latest ]
Expand All @@ -40,11 +40,30 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Golang with cache
uses: magnetikonline/action-golang-cache@v5
# TODO: Replace with actions/setup-go once issue is resolved https://github.com/actions/setup-go/pull/515
- name: Setup Go
uses: antontroshin/setup-go@windows-go-mod-cache
with:
go-version-file: go.mod
go-version-file: 'go.mod'
cache-dependency-path: "go.sum"
- run: make test


end2end:
strategy:
matrix:
platform: [ ubuntu-latest, windows-latest ]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
# TODO: Replace with actions/setup-go once issue is resolved https://github.com/actions/setup-go/pull/515
- name: Setup Go
uses: antontroshin/setup-go@windows-go-mod-cache
with:
go-version-file: 'go.mod'
cache-dependency-path: "go.sum"
- name: Install winget
if: matrix.platform == 'windows-latest'
uses: Cyberboss/install-winget@v1
Expand Down Expand Up @@ -77,9 +96,12 @@ jobs:
msystem: UCRT64
update: true
install: git mingw-w64-ucrt-x86_64-gcc
- uses: actions/setup-go@v4
# TODO: Replace with actions/setup-go once issue is resolved https://github.com/actions/setup-go/pull/515
- name: Setup Go
uses: antontroshin/setup-go@windows-go-mod-cache
with:
go-version-file: 'go.mod'
cache-dependency-path: "go.sum"
- name: Install GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
Expand All @@ -96,7 +118,7 @@ jobs:

steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'

Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Golang with cache
uses: magnetikonline/action-golang-cache@v5
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
go-version-file: 'go.mod'
cache-dependency-path: "go.sum"
- run: make test
- name: Install winget
if: matrix.platform == 'windows-2022'
Expand All @@ -45,6 +46,7 @@ jobs:
- uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
cache-dependency-path: "go.sum"
- shell: bash
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: cache darwin
Expand Down Expand Up @@ -74,6 +76,7 @@ jobs:
- uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
cache-dependency-path: "go.sum"
- shell: bash
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: cache linux
Expand Down Expand Up @@ -133,9 +136,12 @@ jobs:
msystem: UCRT64
update: true
install: git mingw-w64-ucrt-x86_64-gcc
- uses: actions/setup-go@v4
# TODO: Replace with actions/setup-go once issue is resolved https://github.com/actions/setup-go/pull/515
- name: Setup Go
uses: antontroshin/setup-go@windows-go-mod-cache
with:
go-version-file: 'go.mod'
cache-dependency-path: "go.sum"
- name: Release
uses: goreleaser/goreleaser-action@v6
with:
Expand Down
Loading