mirror of
https://github.com/tiennm99/miti99bot.git
synced 2026-08-07 04:24:26 +00:00
ci: bump golangci-lint-action to v7; drop firestore emulator
- golangci-lint-action@v6 doesn't support golangci-lint v2.x; v7 does. This was the only thing breaking CI; subsequent steps were skipped. - Firestore emulator step removed for now — storage_test.go skips when FIRESTORE_EMULATOR_HOST is unset, and the gcloud emulator install adds 30-60s of CI time for tests not yet on the merge-gating path. Re-add when storage-layer changes need emulator coverage.
This commit is contained in:
@@ -26,8 +26,9 @@ jobs:
|
||||
- name: go vet
|
||||
run: go vet ./...
|
||||
|
||||
# golangci-lint-action v7 is required for golangci-lint v2.x.
|
||||
- name: golangci-lint
|
||||
uses: golangci/golangci-lint-action@v6
|
||||
uses: golangci/golangci-lint-action@v7
|
||||
with:
|
||||
version: v2.2.2
|
||||
|
||||
@@ -41,33 +42,13 @@ jobs:
|
||||
go install golang.org/x/vuln/cmd/govulncheck@latest
|
||||
govulncheck ./...
|
||||
|
||||
# Start the Firestore emulator before tests so the storage package's
|
||||
# FIRESTORE_EMULATOR_HOST-gated tests run instead of t.Skip-ing.
|
||||
# gcloud is pre-installed on ubuntu-latest runners; the emulator is
|
||||
# an optional component fetched on first start.
|
||||
- name: start firestore emulator
|
||||
run: |
|
||||
gcloud --quiet components install beta cloud-firestore-emulator || true
|
||||
nohup gcloud beta emulators firestore start \
|
||||
--host-port=localhost:8090 \
|
||||
--quiet > /tmp/firestore.log 2>&1 &
|
||||
# Wait up to 60s for the emulator to bind.
|
||||
for i in $(seq 1 60); do
|
||||
if nc -z localhost 8090; then
|
||||
echo "firestore emulator ready"
|
||||
exit 0
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
echo "firestore emulator failed to start"
|
||||
cat /tmp/firestore.log
|
||||
exit 1
|
||||
|
||||
# Firestore emulator step removed: storage_test.go skips gracefully
|
||||
# when FIRESTORE_EMULATOR_HOST is unset, and the emulator install
|
||||
# adds 30-60s of CI time for tests not yet on the merge-gating path.
|
||||
# Re-add when storage-layer changes need emulator coverage in CI.
|
||||
- name: go test
|
||||
env:
|
||||
FIRESTORE_EMULATOR_HOST: localhost:8090
|
||||
GOOGLE_CLOUD_PROJECT: ci-test-project
|
||||
# Keep test logs out of stdout to avoid drowning real failures.
|
||||
# Quiet test logs so real failures stand out.
|
||||
LOG_LEVEL: error
|
||||
run: go test -race -count=1 -coverprofile=cov.out ./...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user