Skip to content

Commit

Permalink
build(ci): add codecov for unit test coverage reporting
Browse files Browse the repository at this point in the history
build(ci): add codecov bundler plugin for bundle analysis

chore: update readme
  • Loading branch information
kahboom committed Mar 20, 2024
1 parent 0975abd commit 07a7d76
Show file tree
Hide file tree
Showing 6 changed files with 1,412 additions and 58 deletions.
11 changes: 11 additions & 0 deletions .github/codecov.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
coverage:
status:
project:
default:
informational: true
target: auto
threshold: 0.5%
base: auto

github_checks:
annotations: false
5 changes: 5 additions & 0 deletions .github/workflows/unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,8 @@ jobs:
run: npm install
- name: ⚙️ Run tests
run: npm run test --coverage
- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: securesign/rekor-search-ui
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
This repo contains a simple UI for searching Search the Rekor public transparency log.
[![🧪 Unit Tests (Jest) 🧪](https://github.com/securesign/rekor-search-ui/actions/workflows/unit-tests.yaml/badge.svg)](https://github.com/securesign/rekor-search-ui/actions/workflows/unit-tests.yaml)
[![codecov](https://codecov.io/gh/securesign/rekor-search-ui/graph/badge.svg?token=1QS2BK1PQL)](https://codecov.io/gh/securesign/rekor-search-ui)

https://search.sigstore.dev/
This repo contains a simple UI for searching Search the Rekor public transparency log.

![Rekor UI Screenshot](assets/screenshot.png)

Expand Down Expand Up @@ -32,7 +33,7 @@ npm run test

Launches the test runner in the interactive watch mode.

Tests are colocated and live as closely to corresponding code as possible.
Tests are co-located and live as closely to corresponding code as possible.

## Deploy

Expand All @@ -44,5 +45,5 @@ This app supports overriding of the default rekor server instance for those runn
Create a `.env.local` file at the root and include in it this environment variable

```properties
NEXT_PUBLIC_REKOR_DEFAULT_DOMAIN=https://privaterekor.sigstore.dev
NEXT_PUBLIC_REKOR_DEFAULT_DOMAIN=https://privaterekor.example.com
```
17 changes: 17 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const { codecovWebpackPlugin } = require("@codecov/webpack-plugin");

/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
Expand All @@ -14,6 +16,21 @@ const nextConfig = {
"@patternfly/react-icons",
"@patternfly/react-styles",
],
webpack: config => {
config.plugins = [
...config.plugins,

// keep codecov webpack plugin after all other plugins
codecovWebpackPlugin({
enableBundleAnalysis: process.env.CODECOV_TOKEN !== undefined,
bundleName: "rekor-search-ui-webpack-bundle",
uploadToken: process.env.CODECOV_TOKEN,
}),
];

// important: return the modified config
return config;
},
};

module.exports = nextConfig;
Loading

0 comments on commit 07a7d76

Please sign in to comment.