Skip to content

Commit

Permalink
Add workflows for CI
Browse files Browse the repository at this point in the history
  • Loading branch information
evenh committed Jul 30, 2024
1 parent 39b8066 commit 6b44183
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: compile+test
on:
push:
branches:
- '**'
pull_request:
jobs:
compile-and-test:
strategy:
matrix:
go-version: [stable]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Setup cache
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v4
- name: Build and test (no golangci-lint)
run: make build-nolint
23 changes: 23 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: golangci-lint
on:
push:
branches:
- '**'
pull_request:

permissions:
contents: read

jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: stable
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.59.1
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,7 @@ debug:
build: lint test proto-lint generate
go build -trimpath -ldflags="-s -w -X 'main.GitCommitHash=$(version)'"

.PHONY: build-nolint
build-nolint: test proto-lint generate
go build -trimpath -ldflags="-s -w -X 'main.GitCommitHash=$(version)'"

0 comments on commit 6b44183

Please sign in to comment.