Implement MVP: distributed P2P storage with E2E encryption and RS erasure coding #60
This file contains hidden or 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: Go CI | |
| on: | |
| push: | |
| branches: [ main, master ] | |
| pull_request: | |
| branches: [ main, master ] | |
| jobs: | |
| ci: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: v1.25.1 | |
| - name: Cache Go modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/go/pkg/mod | |
| ~/.cache/go-build | |
| key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
| restore-keys: | | |
| ${{ runner.os }}-go- | |
| - name: Download Go modules | |
| run: go mod download | |
| - name: Build all packages | |
| run: go build ./... | |
| - name: Vet | |
| run: go vet ./... | |
| - name: Run tests with coverage | |
| run: | | |
| go test -v -timeout 120s -coverprofile=coverage.out ./... | |
| go tool cover -func=coverage.out | |
| - name: Check filtered coverage threshold | |
| run: | | |
| # Generated proto code, the unimplemented CLI parser, and the | |
| # mosaic-* command entry points are excluded from the threshold | |
| # check. They lack meaningful unit tests by design (generated | |
| # code) or are integration-tested manually. | |
| { echo 'mode: set'; \ | |
| grep -v -E 'tapestry\.pb\.go|/handlers/helpers/|/cli/CLI\.go|/cli/client/|/cmd/' coverage.out \ | |
| | grep -v '^mode:'; } > coverage-filtered.out | |
| coverage=$(go tool cover -func=coverage-filtered.out | grep total | awk '{print substr($3, 1, length($3)-1)}') | |
| echo "Filtered coverage: $coverage%" | |
| threshold=65.0 | |
| awk -v c=$coverage -v t=$threshold 'BEGIN { | |
| if (c < t) { | |
| printf("::error::Filtered coverage (%.1f%%) is below threshold (%.1f%%)\n", c, t); | |
| exit 1 | |
| } | |
| }' | |
| - name: Race detector | |
| run: go test -race -timeout 180s ./... |