Skip to content

Commit

Permalink
ci: add code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
pandatix committed May 18, 2024
1 parent a705b04 commit 1188e73
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
12 changes: 11 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,12 @@ jobs:
fi
- name: Setup CTFd
run: go run cmd/ctfd-setup/main.go
run: |
go build -cover -o ctfd-setup cmd/ctfd-setup/main.go
mkdir coverdir
GOCOVERDIR=coverdir ./ctfd-setup
go tool covdata textfmt -i=coverdir -o cov.out
sed -i '/^\//d' cov.out
env:
URL: http://localhost:8000
APPEARANCE_NAME: 'CTFer.io'
Expand All @@ -61,6 +66,11 @@ jobs:
ADMIN_EMAIL: '[email protected]'
ADMIN_PASSWORD: 'ctfer'

- name: Upload coverage to Coveralls
uses: shogo82148/actions-goveralls@785c9d68212c91196d3994652647f8721918ba11 # v1.9.0
with:
path-to-profile: cov.out

go-lint:
runs-on: ubuntu-latest
steps:
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<div align="center">
<h1>CTFd-Setup</h1>
<p><b>Version your CTFd setup configuration.</b><p>
<a href="https://pkg.go.dev/github.com/ctfer-io/ctfd-setup"><img src="https://shields.io/badge/-reference-blue?logo=go&style=for-the-badge" alt="reference"></a>
<a href=""><img src="https://img.shields.io/github/license/ctfer-io/ctfd-setup?style=for-the-badge" alt="License"></a>
<h1>CTFd-Setup</h1>
<p><b>Version your CTFd setup configuration.</b><p>
<a href="https://pkg.go.dev/github.com/ctfer-io/ctfd-setup"><img src="https://shields.io/badge/-reference-blue?logo=go&style=for-the-badge" alt="reference"></a>
<a href=""><img src="https://img.shields.io/github/license/ctfer-io/ctfd-setup?style=for-the-badge" alt="License"></a>
<a href="https://coveralls.io/github/ctfer-io/ctfd-setup?branch=main"><img src="https://img.shields.io/coverallsCoverage/github/ctfer-io/ctfd-setup?style=for-the-badge" alt="Coverage Status"></a>
<br>
<a href="https://github.com/ctfer-io/ctfd-setup/actions/workflows/codeql-analysis.yaml"><img src="https://img.shields.io/github/actions/workflow/status/ctfer-io/ctfd-setup/codeql-analysis.yaml?style=for-the-badge&label=CodeQL" alt="CodeQL"></a>
<a href="https://securityscorecards.dev/viewer/?uri=github.com/ctfer-io/ctfd-setup"><img src="https://img.shields.io/ossf-scorecard/github.com/ctfer-io/ctfd-setup?label=openssf%20scorecard&style=for-the-badge" alt="OpenSSF Scoreboard"></a>
Expand Down

0 comments on commit 1188e73

Please sign in to comment.