Skip to content

Commit

Permalink
Merge pull request #169 from relab/fix-ci-github-workflows
Browse files Browse the repository at this point in the history
ci: Update GitHub Actions
  • Loading branch information
meling authored Feb 2, 2024
2 parents 674c033 + 532861d commit 40acf14
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 40 deletions.
37 changes: 23 additions & 14 deletions .github/workflows/go-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,39 @@ jobs:
test:
strategy:
matrix:
go-version: [1.17]
go-version: ["1.21"]
platform: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.platform }}

steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Install Protoc
uses: arduino/setup-protoc@master
- name: Cache Go Modules
uses: actions/cache@v3
with:
version: '3.x'
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
path: |
~/.cache/go-build # ubuntu-latest
~/Library/Caches/go-build # macos-latest
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}

- name: Install Protoc
uses: arduino/[email protected]
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Install tools
run: |
make tools
make installgorums
- name: Test
- name: Run Tests
run: make test
54 changes: 28 additions & 26 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -1,49 +1,51 @@
name: golangci-lint
on:
push:
branches: [ master ]
branches: [master]
pull_request:
branches: [ master ]
permissions:
contents: read
# Optional: allow read access to pull request. Use with `only-new-issues` option.
pull-requests: read

jobs:
golangci:
strategy:
matrix:
go-version: [1.17]
name: lint
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}

- name: Install Protoc
uses: arduino/setup-protoc@master
with:
version: '3.x'
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Cache Go modules
uses: actions/cache@v2
- name: Cache Go Modules
uses: actions/cache@v3
with:
path: |
~/.cache/go-build # ubuntu-latest
~/Library/Caches/go-build # macos-latest
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-${{ matrix.go-version }}-go-${{ hashFiles('**/go.sum') }}
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-${{ matrix.go-version }}-go-
${{ runner.os }}-go-
- name: Checkout
uses: actions/checkout@v2
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: "1.21"

- name: Setup Protoc
uses: arduino/[email protected]
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Run Make
run: make

- name: Run golangci-lint
uses: golangci/golangci-lint-action@v2
uses: golangci/golangci-lint-action@v3
with:
version: latest
skip-go-installation: true
skip-pkg-cache: true
skip-build-cache: true
args: --disable errcheck
args: --timeout 5m --disable errcheck
# Optional: show only new issues if it's a pull request. The default value is `false`.
only-new-issues: true

0 comments on commit 40acf14

Please sign in to comment.