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
10 changes: 9 additions & 1 deletion .github/workflows/build-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,15 @@ jobs:
steps:
- uses: "actions/checkout@v5"
- uses: "authzed/actions/setup-go@main"
- uses: "authzed/actions/go-test@main"
- name: "Unit tests with coverage"
run: "go run mage.go test:runWithCoverage"
- name: "Upload coverage to Codecov"
uses: "codecov/codecov-action@v5.5.1"
with:
files: "./coverage.txt"
verbose: true
token: "${{ secrets.CODECOV_TOKEN }}"
fail_ci_if_error: false

development:
name: "WASM Tests"
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ docs/merged.md
# Local-only files
go.work
go.work.sum
coverage.txt
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
[![Discord Server](https://img.shields.io/discord/844600078504951838?color=7289da&logo=discord "Discord Server")](https://authzed.com/discord)
[![Twitter](https://img.shields.io/badge/twitter-%40authzed-1D8EEE?logo=twitter "@authzed on Twitter")](https://twitter.com/authzed)
[![Docker Pulls](https://img.shields.io/docker/pulls/authzed/zed?color=%23448CE6&style=flat-square)](https://hub.docker.com/r/authzed/zed/tags)
[![Codecov](https://img.shields.io/codecov/c/github/authzed/zed)](https://app.codecov.io/gh/authzed/zed)

A command-line client for managing [SpiceDB].

Expand Down
11 changes: 11 additions & 0 deletions mage.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//go:build ignore

package main

import (
"os"

"github.com/magefile/mage/mage"
)

func main() { os.Exit(mage.Main()) }
3 changes: 3 additions & 0 deletions magefiles/build.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build mage
// +build mage

package main

import (
Expand Down
21 changes: 21 additions & 0 deletions magefiles/test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//go:build mage
// +build mage

package main

import (
"github.com/magefile/mage/mg"
"github.com/magefile/mage/sh"
)

type Test mg.Namespace

// Run runs unit tests
func (g Test) Run() error {
return sh.RunV("go", "test", "-race", "-count=1", "-timeout=10m", "./...")
}

// RunWithCoverage runs unit tests and measures coverage (useful for CI)
func (g Test) RunWithCoverage() error {
return sh.RunV("go", "test", "-race", "-count=1", "-timeout=10m", "-covermode=atomic", "-coverprofile=coverage.txt", "./...")
}
Loading