From 83568bf6b811e2c1b8465deb81bc6e1ae1fafa99 Mon Sep 17 00:00:00 2001 From: Wessie Date: Wed, 21 Feb 2024 15:49:06 +0000 Subject: [PATCH] actions: add staticcheck action separate from build&test updated README --- .github/workflows/staticcheck.yml | 11 +++++++++++ .github/workflows/{go.yml => test.yml} | 13 ++----------- README.md | 22 ++++++++++++---------- 3 files changed, 25 insertions(+), 21 deletions(-) create mode 100644 .github/workflows/staticcheck.yml rename .github/workflows/{go.yml => test.yml} (71%) diff --git a/.github/workflows/staticcheck.yml b/.github/workflows/staticcheck.yml new file mode 100644 index 00000000..757eec52 --- /dev/null +++ b/.github/workflows/staticcheck.yml @@ -0,0 +1,11 @@ +name: "staticcheck" +on: ["push", "pull_request"] + +jobs: + staticcheck: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 1 + - uses: dominikh/staticcheck-action@v1.3.0 \ No newline at end of file diff --git a/.github/workflows/go.yml b/.github/workflows/test.yml similarity index 71% rename from .github/workflows/go.yml rename to .github/workflows/test.yml index 2148c55d..45f23d1e 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/test.yml @@ -1,10 +1,7 @@ -# This workflow will build a golang project -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go - -name: Build and Test +name: test on: [push, pull_request] jobs: - build: + test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -36,9 +33,3 @@ jobs: - name: Test run: go test -v ./... - - - name: Staticcheck - uses: dominikh/staticcheck-action@v1.2.0 - with: - install-go: false - diff --git a/README.md b/README.md index 826ce84e..8ddea199 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,18 @@ # valkyrie +[![Go Reference](https://pkg.go.dev/badge/github.com/R-a-dio/valkyrie.svg)](https://pkg.go.dev/github.com/R-a-dio/valkyrie) +![Test](https://github.com/github/docs/actions/workflows/test.yml/badge.svg) +![Staticcheck](https://github.com/github/docs/actions/workflows/staticcheck.yml/badge.svg) + Repository of rebirth Installation ===== -`git clone https://github.com/R-a-dio/valkyrie.git` into location of your choosing because we use the new go modules that don't require a `GOPATH`. To avoid weird tooling issues it's best to completely avoid your `GOPATH` when working with modules so don't clone it into your `GOPATH`. +`git clone https://github.com/R-a-dio/valkyrie.git` Required ----- -- Go version 1.12+ +- Go version 1.21+ - MySQL/MariaDB Optional @@ -18,8 +22,11 @@ for work and running of `streamer/` - ffprobe - libmp3lame-dev -for work in `rpc/` -- [twirp](https://twitchtv.github.io/twirp/docs/install.html) +for work in `rpc/` and running `go generate` +- [protoc](https://github.com/protocolbuffers/protobuf#protobuf-compiler-installation) +- `go install google.golang.org/protobuf/cmd/protoc-gen-go@latest` +- `go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest` +- `go install github.com/matryer/moq@latest` Building ===== @@ -34,9 +41,4 @@ an example configuration file is included as `example.toml`. Other documentation - the flag `-config` given to the executable - the environment variable `HANYUU_CONFIG` which can either be a relative or absolute path -You can also run `hanyuu config` to see what the currently loaded configuration looks like, the output is a valid TOML file so can also be piped into a file if so desired - -Before you commit ------ - -If you've edited `rpc/radio.proto` or added a migration file under `migrations/` you should run `go generate` before you commit. \ No newline at end of file +You can also run `hanyuu config` to see what the currently loaded configuration looks like, the output is a valid TOML file so can also be piped into a file if so desired \ No newline at end of file