Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/go-coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Go Baseline Coverage

on:
push:
paths:
- 'workspaces/backend/**'
branches:
- notebook-v2

permissions:
contents: write

jobs:
test:
name: Run Tests and Generate Coverage
runs-on: ubuntu-latest

defaults:
run:
working-directory: workspaces/backend # 👈 where your go.mod is

steps:
- name: Checkout Code
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: workspaces/backend/go.mod
check-latest: true
cache-dependency-path: workspaces/backend/go.sum

- name: Download Dependencies
run: go mod download

- name: Run Tests with Coverage
run: |
go test ./api/... -coverprofile=coverage.baseline

- name: Commit backend coverage file
run: |
git config --global user.name 'GitHub Actions'
git config --global user.email '[email protected]'
git add coverage.baseline
git commit -m "Update coverage baseline" || echo "No changes to commit"
git push origin HEAD:notebook-v2
2 changes: 1 addition & 1 deletion workspaces/backend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*.dll
*.so
*.dylib
bin/*
bin/**/*
Dockerfile.cross

# Test binary, built with `go test -c`
Expand Down
1 change: 1 addition & 0 deletions workspaces/backend/api/workspaces_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ func (a *App) GetWorkspaceHandler(w http.ResponseWriter, r *http.Request, ps htt
},
),
}

if success := a.requireAuth(w, r, authPolicies); !success {
return
}
Expand Down
Loading