feat(chore): code quality with lint, tests and CI #3
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run static tests | |
on: | |
pull_request: | |
workflow_dispatch: | |
env: | |
GO_VERSION: '1.22' | |
jobs: | |
static-validation: | |
services: | |
redis: | |
image: redis | |
ports: | |
- 6379:6379 | |
etcd: | |
image: quay.io/coreos/etcd:v3.5.13 | |
env: | |
ETCD_NAME: etcd0 | |
ETCD_ADVERTISE_CLIENT_URLS: http://etcd:2379,http://etcd:4001 | |
ETCD_LISTEN_CLIENT_URLS: http://0.0.0.0:2379,http://0.0.0.0:4001 | |
ETCD_INITIAL_ADVERTISE_PEER_URLS: http://etcd:2380 | |
ETCD_LISTEN_PEER_URLS: http://0.0.0.0:2380 | |
ETCD_INITIAL_CLUSTER_TOKEN: etcd-cluster-1 | |
ETCD_INITIAL_CLUSTER: etcd0=http://etcd:2380 | |
ETCD_INITIAL_CLUSTER_STATE: new | |
ports: | |
- 2379:2379 | |
- 2380:2380 | |
- 4001:4001 | |
strategy: | |
matrix: | |
submodules: | |
- badger | |
- core | |
- etcd | |
- nuts | |
- otter | |
- redis | |
name: Validate Go code linting | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@v3 | |
with: | |
working-directory: ${{ matrix.submodules }} | |
- name: unit tests | |
run: go test -v -race ./${{ matrix.submodules }} |