Skip to content

Commit

Permalink
Add simple go CI
Browse files Browse the repository at this point in the history
  • Loading branch information
kachick committed Jul 27, 2023
1 parent 23b1c25 commit 8a331e5
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 1 deletion.
46 changes: 46 additions & 0 deletions .github/workflows/ci-go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: CI

on:
push:
branches:
- main
paths:
- '.github/workflows/ci-go.yml'
- '**.go'
- 'go.*'
- 'testdata/**'
pull_request:
paths:
- '.github/workflows/ci-go.yml'
- '**.go'
- 'go.*'
- 'testdata/**'

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
cache-dependency-path: 'go.sum'
- uses: davidB/rust-cargo-make@v1
with:
# Keep same version as used in *.nix
version: '0.36.10'
# - run: go test
- run: makers test-race
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
cache-dependency-path: 'go.sum'
- name: check format
run: go fmt ./... && git add --intent-to-add . && git diff --exit-code
- run: go vet ./...
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Keep same version as *.nix
# Keep same version as used in *.nix
- uses: crate-ci/[email protected]
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@
# Managed by home-manager
.config/fish/conf.d/
.config/fish/config.fish

dist/
11 changes: 11 additions & 0 deletions Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,14 @@ args = [
'run',
'./cmd/print-deps',
]

[tasks.test-race]
command = 'go'
args = [
'build',
'-v',
'-race',
'-o',
'dist/print-deps',
'./...',
]
1 change: 1 addition & 0 deletions scripts/lint.bash
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ shellcheck ./**/*.bash
nixpkgs-fmt --check ./**/*.nix
typos . .github .config .vscode
gitleaks detect
go vet ./...

0 comments on commit 8a331e5

Please sign in to comment.