Skip to content

Commit

Permalink
Improve GitHub workflows (#34)
Browse files Browse the repository at this point in the history
- use the same Go version everywhere
- standardize YAML whitespacve and quoting
- add missing strategy (job level item)
  • Loading branch information
philoserf committed Sep 26, 2023
1 parent dfd3fef commit 23b3332
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 29 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: 1.18
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.48
version: v1.48
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
workflow_dispatch:
inputs:
release_id:
description: 'Release id (tag name)'
description: "Release id (tag name)"
required: true
jobs:
create_release:
Expand All @@ -25,7 +25,7 @@ jobs:
- [**MacOS** Intel](https://github.com/skatkov/stoic/releases/download/${{ github.event.inputs.release_id }}/stoic-mac-intel.zip)
- [**MacOS** M1 (ARM)](https://github.com/skatkov/stoic/releases/download/${{ github.event.inputs.release_id }}/stoic-mac-arm.zip)
- [**Linux**](https://github.com/skatkov/stoic/releases/download/${{ github.event.inputs.release_id }}/stoic-linux.zip)
release_name: ${{ github.event.inputs.release_id }}
prerelease: true
draft: true
Expand All @@ -52,7 +52,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '1.18'
go-version: "1.18"
- name: Build binary
env:
GOOS: ${{ matrix.go_os }}
Expand Down
51 changes: 27 additions & 24 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,34 @@ jobs:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- uses: actions/checkout@v3
- run: go test ./...
- uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- uses: actions/checkout@v3
- run: go test ./...

test-cache:
strategy:
matrix:
go-version: [1.18.x]
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.18.x
- uses: actions/checkout@v3
- uses: actions/cache@v2
with:
# In order:
# * Module download cache
# * Build cache (Linux)
# * Build cache (Mac)
path: |
~/go/pkg/mod
~/.cache/go-build
~/Library/Caches/go-build
~\AppData\Local\go-build
key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-${{ matrix.go-version }}-
- run: go test ./...
- uses: actions/setup-go@v3
with:
go-version: 1.18.x
- uses: actions/checkout@v3
- uses: actions/cache@v2
with:
# In order:
# * Module download cache
# * Build cache (Linux)
# * Build cache (Mac)
path: |
~/go/pkg/mod
~/.cache/go-build
~/Library/Caches/go-build
~\AppData\Local\go-build
key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-${{ matrix.go-version }}-
- run: go test ./...

0 comments on commit 23b3332

Please sign in to comment.