forgejo/contrib
Earl Warren 7d3fcde71c chore: collect coverage using GOCOVERDIR (#9004)
- run all unit tests and integration tests in sequence in the same job
- upload the coverage data as an artifact to the run
- only run via dispatch because it is very long
- arguments are used to select which unit or integration tests to focus on

Refs https://go.dev/blog/integration-test-coverage

### Testing

- Run this workflow via workflow_dispatch (see https://codeberg.org/forgejo-integration/forgejo/actions/runs/11889)
- Download the coverage information (see https://codeberg.org/forgejo-integration/forgejo/actions/runs/11889/artifacts/coverage)
- Download the coverage information from an end-to-end cascade test (see https://code.forgejo.org/forgejo/end-to-end/actions/runs/3961)
- Unzip them in a the `coverage/data` sub-directory at the root of the Forgejo source tree
    ```sh
    $ ls coverage/data
    actions  coverage-actions.zip  coverage-federation.zip  coverage-tests.zip  coverage-upgrade.zip  federation  tests  upgrade
    ```
- Display the coverage percentage
```
$ make coverage-show-percentage
...
forgejo.org/services/wiki/wiki_path.go:96:					WebPathToGitPath						81.8%
forgejo.org/services/wiki/wiki_path.go:113:					GitPathToWebPath						90.0%
forgejo.org/services/wiki/wiki_path.go:129:					WebPathToUserTitle						71.4%
forgejo.org/services/wiki/wiki_path.go:140:					WebPathToURLPath						100.0%
forgejo.org/services/wiki/wiki_path.go:144:					WebPathFromRequest						100.0%
forgejo.org/services/wiki/wiki_path.go:151:					UserTitleToWebPath						80.0%
forgejo.org/services/wiki/wiki_path.go:163:					ToWikiPageMetaData						100.0%
forgejo.org/tests/integration/api_repo_file_helpers.go:18:			createFileInBranch						100.0%
...
total:										(statements)							63.9%
```

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9004
Reviewed-by: jerger <jerger@noreply.codeberg.org>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-08-26 10:10:46 +02:00
..
autocompletion Remove shebang from bash autocompletion (#8137) 2025-06-12 00:07:10 +02:00
environment-to-ini Update environment-to-ini README (#8183) 2025-06-13 21:59:26 +02:00
fhs-compliant-script Fix issue with docker-rootless shimming script (#18690) 2022-02-10 01:15:06 -05:00
gitea-monitoring-mixin feat: support artifact uploads for OCI container packages (#8070) 2025-06-09 10:14:53 +02:00
ide chore: set recommend vscode settings for golangci-lint 2024-11-11 10:53:47 +01:00
init Add init file for Ubuntu (#23362) 2023-03-09 16:54:37 -06:00
launchd
legal branding: update contrib/legal 2024-12-19 18:55:20 +05:00
options/label Adding advanced label set. (#11298) 2020-05-07 07:47:34 +01:00
supervisor
systemd Switch to FORGEJO_WORK_DIR in the systemd service configuration file (#4850) 2024-08-06 14:56:13 +00:00
coverage-helper.sh chore: collect coverage using GOCOVERDIR (#9004) 2025-08-26 10:10:46 +02:00
README Synced gitignores with github repo (#1245) 2017-03-15 13:30:00 +01:00
update_dependencies.sh bump go deps (#19021) 2022-03-08 19:15:30 +08:00
upgrade.sh [BRANDING] adapt forgejo/contrib/upgrade.sh 2024-02-05 16:05:01 +01:00

All files in subdirectories are templates, do modifications based on your environment first.