add CI workflow

* silence lint errors in certain errchecks
* golangci-lint: skip go installation step
* silence lint error in ResponseWriter Write call

Fixes #13
absences
William Perron 2 years ago
parent 99d527f83e
commit ad22f31bcd

@ -0,0 +1,22 @@
name: GitHub Actions Demo
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.19
- uses: actions/checkout@v3
- name: "fmt"
run: test -z $(go fmt ./...)
- name: lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
skip-go-intallation: true
skip-pkg-cache: true
skip-build-cache: true
args: --timeout 2m
- name: test
run: go test ./...

@ -528,7 +528,7 @@ func handleClaimAutocomplete(ctx context.Context, store *themis.Store, s *discor
func serve(address string) error { func serve(address string) error {
http.Handle("/health", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { http.Handle("/health", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Write([]byte("OK")) w.Write([]byte("OK")) //nolint:errcheck // this is expected to always work, 'trust me bro' guaranteed
})) }))
return http.ListenAndServe(address, nil) return http.ListenAndServe(address, nil)

@ -96,7 +96,7 @@ func (s *Store) Claim(ctx context.Context, userId, player, province string, clai
if err != nil { if err != nil {
return 0, fmt.Errorf("failed to begin transaction: %w", err) return 0, fmt.Errorf("failed to begin transaction: %w", err)
} }
defer tx.Commit() defer tx.Commit() //nolint:errcheck
conflicts, err := s.FindConflicts(ctx, userId, province, claimType) conflicts, err := s.FindConflicts(ctx, userId, province, claimType)
if err != nil { if err != nil {

@ -1,3 +1,4 @@
//nolint:errcheck
package themis package themis
import ( import (

Loading…
Cancel
Save