Add comprehensive test automation setup with GitHub Actions: - Create test.yml for running tests on main/develop branches - Add pr-test.yml for PR validation with test results comments - Add update-badges.yml for dynamic test status badge updates - Configure code coverage reporting with Codecov integration Documentation: - Add BADGE_SETUP.md with instructions for configuring test status badges - Add WORKFLOWS_GUIDE.md explaining CI/CD workflow setup - Update README.md with build and test status badges Test Framework: - Configure test project to use .NET 9.0 - Set up test coverage reporting with coverlet - Add integration tests with WireMock for API mocking - Add unit tests for configuration and HTTP client components - Document testing strategy in TestingStrategy.md Build: - Add Dockerfile.test for containerized testing - Update .gitignore for test artifacts - Configure test dependencies in VRCAuthProxy.Tests.csproj This change enables automated testing on PRs and branches, with visual status indicators and detailed test results in PR comments.
1.6 KiB
1.6 KiB
Setting Up GitHub Badges
This document explains how to set up the GitHub Secrets required for the test status badge functionality.
Steps to Create a GitHub Gist for Badge Storage
-
Create a new public GitHub Gist at https://gist.github.com/
- Add a file named
vrcauthproxy-tests.jsonwith the following content:
{ "schemaVersion": 1, "label": "tests", "message": "unknown", "color": "lightgrey" }- Save the Gist
- Add a file named
-
Note the Gist ID from the URL
- The URL will look like:
https://gist.github.com/YOUR_USERNAME/GIST_ID - Copy the
GIST_IDpart
- The URL will look like:
Creating GitHub Secrets
-
In your VRCAuthProxy repository, go to Settings > Secrets and variables > Actions
-
Create the following secrets:
-
GIST_ID
- Value: The Gist ID you copied in step 2 above
-
GIST_SECRET
- Value: A GitHub Personal Access Token (PAT) with
gistscope - To create a PAT, go to your GitHub account Settings > Developer settings > Personal access tokens > Tokens (classic)
- Generate a new token with at least the
gistscope - Copy the token value (you won't be able to see it again after leaving the page)
- Value: A GitHub Personal Access Token (PAT) with
-
-
Update the README.md badge URL
- Replace
USER_PLACEHOLDERwith your GitHub username - Replace
GIST_ID_PLACEHOLDERwith your Gist ID
- Replace
Testing the Setup
After setting up the secrets and updating the README.md, push a commit to the main branch to trigger the workflow that will update the badge status.
If everything is set up correctly, the badge in the README should display the current test status (passing or failing).