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