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

ci: Update GitHub Actions #169

Merged
merged 1 commit into from
Feb 2, 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
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
Loading