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.
64 lines
No EOL
1.9 KiB
Markdown
64 lines
No EOL
1.9 KiB
Markdown
# GitHub Actions Workflows Guide
|
|
|
|
This document explains the GitHub Actions workflows set up for this project.
|
|
|
|
## Available Workflows
|
|
|
|
### 1. Run Tests Workflow (`test.yml`)
|
|
|
|
This workflow runs on pushes to `main` and `develop` branches, as well as on pull requests to these branches. It:
|
|
|
|
- Builds the project
|
|
- Runs all tests
|
|
- Generates code coverage reports
|
|
- Uploads coverage to Codecov
|
|
- Updates the test status badge (on push to main)
|
|
|
|
### 2. Update Badges Workflow (`update-badges.yml`)
|
|
|
|
This workflow runs whenever the "Run Tests" workflow completes. It:
|
|
|
|
- Updates the test status badge based on the test results (passing/failing)
|
|
|
|
### 3. PR Tests Workflow (`pr-test.yml`)
|
|
|
|
This workflow runs on pull requests to `main` and `develop` branches. It:
|
|
|
|
- Builds the project
|
|
- Runs all tests
|
|
- Generates test results and code coverage reports
|
|
- Comments on the PR with test results
|
|
- Uploads coverage reports to Codecov
|
|
|
|
### 4. Build Docker Image Workflow (existing `build.yml`)
|
|
|
|
This workflow runs on pushes to the `main` branch. It:
|
|
|
|
- Builds the Docker image
|
|
- Pushes the image to the GitHub Container Registry
|
|
|
|
## Setting Up Badge Functionality
|
|
|
|
To enable the badge functionality, follow the instructions in [BADGE_SETUP.md](BADGE_SETUP.md).
|
|
|
|
## GitHub Secrets
|
|
|
|
The following GitHub Secrets are required:
|
|
|
|
- `GIST_SECRET`: A GitHub Personal Access Token with `gist` scope
|
|
- `GIST_ID`: The ID of the GitHub Gist used to store badge data
|
|
|
|
## Badge in README
|
|
|
|
The README includes two badges:
|
|
1. Build Status: Shows the status of the most recent build workflow
|
|
2. Tests Status: Shows whether the tests are passing or failing
|
|
|
|
## Workflow Customization
|
|
|
|
You can customize these workflows by editing the YAML files in the `.github/workflows` directory:
|
|
|
|
- `.github/workflows/test.yml`
|
|
- `.github/workflows/update-badges.yml`
|
|
- `.github/workflows/pr-test.yml`
|
|
- `.github/workflows/build.yml` |