chore: bump google.golang.org/grpc from 1.67.1 to 1.70.0 #17
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: Backend Tests | |
on: | |
pull_request: | |
branches: | |
- main | |
- "release/*.*.*" | |
paths: | |
- "backend/**" | |
- "go.mod" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
go-tests: | |
runs-on: self-hosted | |
timeout-minutes: 30 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: 1.23.2 | |
cache: false | |
- name: Verify go.mod is tidy | |
run: | | |
go mod tidy | |
git diff --exit-code | |
- name: Cache MySQL | |
uses: actions/cache@v4 | |
with: | |
path: | | |
./backend/resources/mysql/*.tar.gz | |
./backend/resources/mysql/*.tar.xz | |
key: ${{ runner.OS }}-build-mysql-cache | |
- name: Install dependencies | |
run: go generate -tags mysql ./... | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@v6 | |
with: | |
version: v1.60.2 | |
args: --verbose --timeout 20m --max-same-issues=30 --allow-parallel-runners | |
- name: Run all tests | |
run: go test -p=8 -tags=mysql -v ./backend/... | tee test.log; exit ${PIPESTATUS[0]} | |
- name: Pretty print tests running time | |
# grep: filter out lines like "--- PASS: TestVCS (15.04s)" | |
# sed: remove unnecessary characters | |
# awk: re-format lines to "PASS: TestVCS (15.04s)" | |
# sort: cut into columns by delimiter ' ' (single space) and sort by column 3 (test time in seconds) as numeric type in reverse order (largest comes first) | |
# awk: accumulate sum by test time in seconds | |
run: grep --color=never -e '--- PASS:' -e '--- FAIL:' test.log | sed 's/[:()]//g' | awk '{print $2,$3,$4}' | sort -t' ' -nk3 -r | awk '{sum += $3; print $1,$2,$3,sum"s"}' |