|  | 
|  | 1 | +# GitHub Workflows | 
|  | 2 | + | 
|  | 3 | +This document provides an overview of the CI/CD workflows used in this | 
|  | 4 | +repository. These workflows help maintain code quality, automate dependency | 
|  | 5 | +management, and validate changes before they are merged. | 
|  | 6 | + | 
|  | 7 | +## Table of Contents | 
|  | 8 | + | 
|  | 9 | +- [Main Development Workflow](#main-development-workflow-devyml) | 
|  | 10 | +- [Linting and Validation Workflows](#linting-and-validation-workflows) | 
|  | 11 | +- [Dependency Management](#dependency-management) | 
|  | 12 | +- [License and Security Scanning](#license-and-security-scanning) | 
|  | 13 | +- [Merge Control](#merge-control) | 
|  | 14 | + | 
|  | 15 | +--- | 
|  | 16 | + | 
|  | 17 | +## Main Development Workflow (`dev.yml`) | 
|  | 18 | + | 
|  | 19 | +### Purpose | 
|  | 20 | + | 
|  | 21 | +Primary CI workflow that ensures developer experience is good by building and | 
|  | 22 | +testing the codebase in a vanilla Ubuntu environment using standard tooling. | 
|  | 23 | + | 
|  | 24 | +The workflow runs several jobs. Some of them only run if users opt in, such as | 
|  | 25 | +the VLAB/HLAB tests. See the lists of dispatch options and Pull Requests labels | 
|  | 26 | +below for details. | 
|  | 27 | + | 
|  | 28 | +### Triggers | 
|  | 29 | + | 
|  | 30 | +- Pull Requests | 
|  | 31 | +- Pushes to `main` branch | 
|  | 32 | +- Merge group checks | 
|  | 33 | +- Manual dispatch (workflow\_dispatch) | 
|  | 34 | + | 
|  | 35 | +### Main steps | 
|  | 36 | + | 
|  | 37 | +1. Check code changes to determine which tests are required | 
|  | 38 | +2. Build and test across multiple profiles and environments: | 
|  | 39 | +   - Profiles: `debug`, `release`, `fuzz` | 
|  | 40 | +   - Build modes: sterile (clean environment) and developer (local-like | 
|  | 41 | +     environment) | 
|  | 42 | +3. Run cargo deny checks for license and security issues | 
|  | 43 | +4. Push container images (for sterile release/debug builds) | 
|  | 44 | +5. Execute tests: | 
|  | 45 | +   - Regular tests using `cargo nextest` | 
|  | 46 | +   - Shuttle tests (concurrent execution testing) | 
|  | 47 | +   - Fuzz tests with coverage | 
|  | 48 | +6. Run `cargo clippy` for linting | 
|  | 49 | +7. Generate documentation with `rustdoc` | 
|  | 50 | +8. Upload test results and coverage to Codecov | 
|  | 51 | +9. Publish test reports with flaky test detection | 
|  | 52 | +10. Run VLAB/HLAB integration tests (virtual/hybrid lab environments) | 
|  | 53 | + | 
|  | 54 | +### Manual dispatch options | 
|  | 55 | + | 
|  | 56 | +- `debug_enabled` - Enable tmate session for debugging on failure | 
|  | 57 | +- `debug_justfile` - Show debug statements from just recipes | 
|  | 58 | +- `run_vlab_tests` - Run VLAB (virtual lab) tests | 
|  | 59 | +- `run_hlab_tests` - Run HLAB (hybrid lab) tests | 
|  | 60 | +- `enable_release_tests` - Enable release tests for VLAB/HLAB | 
|  | 61 | + | 
|  | 62 | +### Pull Request label options | 
|  | 63 | + | 
|  | 64 | +- `ci:+vlab` - Run VLAB tests on this PR | 
|  | 65 | +- `ci:+hlab` - Run HLAB tests on this PR | 
|  | 66 | +- `ci:+release` - Enable release tests for VLAB/HLAB on this PR | 
|  | 67 | + | 
|  | 68 | +### Job matrix | 
|  | 69 | + | 
|  | 70 | +- Profiles: debug, release, fuzz | 
|  | 71 | +- Build modes: sterile and developer environments | 
|  | 72 | +- VLAB configurations: spine-leaf fabric mode, with/without gateway, | 
|  | 73 | +  L2VNI/L3VNI VPC modes | 
|  | 74 | + | 
|  | 75 | +### Artifacts | 
|  | 76 | + | 
|  | 77 | +- Test results (JUnit XML) | 
|  | 78 | +- Coverage reports (Codecov JSON) | 
|  | 79 | +- Container images pushed to GitHub Container Registry | 
|  | 80 | + | 
|  | 81 | +--- | 
|  | 82 | + | 
|  | 83 | +## Linting and Validation Workflows for Pull Requests | 
|  | 84 | + | 
|  | 85 | +### Rust Code Formatting (`lint-cargo-fmt.yml`) | 
|  | 86 | + | 
|  | 87 | +Ensure Rust code is consistently formatted using `rustfmt`. | 
|  | 88 | + | 
|  | 89 | +### License Headers Check (`lint-license-headers.yml`) | 
|  | 90 | + | 
|  | 91 | +Verify that all source files have SPDX license headers and copyright notices. | 
|  | 92 | + | 
|  | 93 | +### Commit Message Validation (`lint-commitlint.yml`) | 
|  | 94 | + | 
|  | 95 | +Ensure commit messages follow the [Conventional Commits] specification. | 
|  | 96 | + | 
|  | 97 | +[Conventional Commits]: https://www.conventionalcommits.org/ | 
|  | 98 | + | 
|  | 99 | +Accepted commit title prefixes: | 
|  | 100 | + | 
|  | 101 | +- `build`, `bump`, `chore`, `ci`, `docs`, `feat`, `fix`, `perf`, `refactor`, | 
|  | 102 | +  `revert`, `style`, `test` | 
|  | 103 | + | 
|  | 104 | +### Dependabot Configuration Validation (`lint-validate-dependabot.yml`) | 
|  | 105 | + | 
|  | 106 | +Validate the Dependabot configuration file for correctness. | 
|  | 107 | + | 
|  | 108 | +Triggers for Pull Requests that modify `.github/dependabot.yml` or the | 
|  | 109 | +associated workflow file. | 
|  | 110 | + | 
|  | 111 | +--- | 
|  | 112 | + | 
|  | 113 | +## Dependency Management | 
|  | 114 | + | 
|  | 115 | +### Automated Dependency Updates (`bump.yml`) | 
|  | 116 | + | 
|  | 117 | +#### Purpose | 
|  | 118 | + | 
|  | 119 | +Automatically check for and update Cargo dependencies, creating a Pull Request | 
|  | 120 | +with the changes. Each package is upgraded in a separate commit to ease review. | 
|  | 121 | + | 
|  | 122 | +#### Triggers | 
|  | 123 | + | 
|  | 124 | +- Weekly schedule: Mondays at 3:18 AM UTC | 
|  | 125 | +- Manual dispatch (workflow\_dispatch) | 
|  | 126 | + | 
|  | 127 | +#### Manual dispatch options | 
|  | 128 | + | 
|  | 129 | +- `debug_enabled` - Enable tmate session for debugging on failure | 
|  | 130 | + | 
|  | 131 | +#### Main steps | 
|  | 132 | + | 
|  | 133 | +1. Install required tools (`just`, `cargo-edit`, `cargo-deny`) | 
|  | 134 | +2. Set up build environment | 
|  | 135 | +3. Run `cargo deny check` (pre-upgrade, continue on error) | 
|  | 136 | +4. Run `cargo update` to update within version constraints | 
|  | 137 | +5. Run `cargo upgrade` to find and apply upgrades (including incompatible versions) | 
|  | 138 | +6. Create individual commits for each package upgrade | 
|  | 139 | +7. Run `cargo deny check` again (post-upgrade, must pass) | 
|  | 140 | +8. Create a Pull Request with all upgrade commits | 
|  | 141 | + | 
|  | 142 | +--- | 
|  | 143 | + | 
|  | 144 | +## License and Security Scanning | 
|  | 145 | + | 
|  | 146 | +### FOSSA Scan (`fossa.yml`) | 
|  | 147 | + | 
|  | 148 | +Perform license compliance and security vulnerability scanning using FOSSA. | 
|  | 149 | +Reports are available on the [FOSSA Dashboard]. | 
|  | 150 | + | 
|  | 151 | +[FOSSA Dashboard]: https://app.fossa.com/projects/custom%252B43661%252Fgithub.202132.xyz%252Fgithedgehog%252Fdataplane/ | 
|  | 152 | + | 
|  | 153 | +--- | 
|  | 154 | + | 
|  | 155 | +## Merge Control | 
|  | 156 | + | 
|  | 157 | +### Mergeability Check (`mergeability.yml`) | 
|  | 158 | + | 
|  | 159 | +Block Pull Request merges based if the `dont-merge` label is set. | 
|  | 160 | + | 
|  | 161 | +Runs and checks for the presence of the label on various Pull Request events: | 
|  | 162 | +`synchronize`, `opened`, `reopened`, `labeled`, `unlabeled`. | 
0 commit comments