add custom formatting #2399
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: Build | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Go | |
uses: actions/[email protected] | |
with: | |
go-version: 1.20.6 | |
id: go | |
- name: Check out code into the Go module directory | |
uses: actions/[email protected] | |
- name: Get dependencies | |
run: | | |
go get -v -t -d ./... | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/[email protected] | |
with: | |
node-version: 20.3.1 | |
- name: Building static assets | |
run: (cd web/client && yarn install --immutable && yarn build) | |
- name: Enforce Go formatted code | |
run: | | |
make fmt | |
if [[ -z $(git status --porcelain) ]]; then | |
echo "Git directory is clean." | |
else | |
echo "Git directory is dirty. Run make fmt locally and commit any formatting fixes or generated code." | |
git status --porcelain | |
exit 1 | |
fi | |
- name: Install tools | |
run: make install-tools | |
- name: Build | |
run: make build | |
# Temporary disabled lint job because of this issue | |
# https://github.com/golangci/golangci-lint/issues/3107 | |
# - name: Lint | |
# run: make lint | |
- name: Test | |
run: go test -race -coverprofile=./c.out -covermode=atomic -v ./... | |
- name: Report code coverage | |
env: | |
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
go install github.com/mattn/goveralls@latest | |
goveralls -coverprofile=./c.out -service=github |