Workflow Trigger Configuration
This document explains when each workflow runs and what triggers them.
TSI Tests Workflow
File: .github/workflows/test.yml
Purpose: Tests the TSI source code (Rust implementation, builds, linting)
Triggers:
- ✅ Runs when:
- src/** - Source code files
- Cargo.toml - Build configuration
- packages/** - Package files
- .github/workflows/test.yml - The workflow file itself
- ❌ Does NOT run when:
- Documentation changes (
docs/**,README.md) - Only other workflow files change
Jobs:
- test: Tests Rust build and functionality (matrix: ubuntu-latest, macos-latest, windows-latest); runs cargo build --release, cargo test, cargo clippy, cargo fmt --check
Manual Trigger: Yes, can be triggered manually via workflow_dispatch
Validate Packages Workflow
File: .github/workflows/validate-packages.yml
Purpose: Validates package JSON files and ensures TSI can parse them
Triggers:
- ✅ Only runs when package files change:
- packages/**/*.json - Package definition files
- .github/workflows/validate-packages.yml - The workflow file itself
- ❌ Does NOT run when:
- TSI source code changes
- Documentation changes
- Other workflow files change
Jobs:
- validate-format: Validates JSON syntax and structure
- validate-tsi-parsing: Tests that TSI can parse all packages
- validate-dependencies: Validates package dependencies
- test-package-install: Smoke tests TSI commands (info, list, search, doctor, install)
Manual Trigger: Yes, can be triggered manually via workflow_dispatch
Discover Versions Workflow
File: .github/workflows/discover-versions.yml
Purpose: Automatically discovers and updates package versions
Triggers:
- Scheduled: Weekly on Mondays at 00:00 UTC
- Manual: Via workflow_dispatch
Note: This workflow doesn't use path filters because it needs to read all package files to discover versions.
Sync External Packages Workflow
File: .github/workflows/sync-external-packages.yml
Purpose: Syncs package definitions from external repositories
Triggers:
- Manual: Via workflow_dispatch
- Webhook: Via repository_dispatch (for external triggers)
Summary
| Workflow | Triggers on Source Code | Triggers on Packages | Scheduled |
|---|---|---|---|
| TSI Tests | ✅ Yes | ✅ Yes | ❌ No |
| Validate Packages | ❌ No | ✅ Yes | ❌ No |
| Discover Versions | ❌ No | ❌ No | ✅ Weekly |
| Sync External | ❌ No | ❌ No | ❌ No |
Benefits
- Faster CI/CD: Tests only run when relevant code changes
- Reduced costs: Fewer unnecessary workflow runs
- Clear separation: Source code tests vs package validation
- Better feedback: Developers get faster feedback on their changes
Testing the Configuration
Test 1: Source Code Change
# Make a change to source code
echo "// test" >> src/main.rs
git commit -am "test: source code change"
git push
Expected: TSI Tests workflow runs, Validate Packages does NOT run
Test 2: Package File Change
# Make a change to a package file
echo '{"test": true}' >> packages/test.json
git commit -am "test: package change"
git push
Expected: Both TSI Tests and Validate Packages workflows run (both trigger on packages/**)
Test 3: Documentation Change
# Make a change to documentation
echo "# test" >> README.md
git commit -am "test: documentation change"
git push
Expected: Neither workflow runs (unless workflow files themselves changed)
Manual Override
Both workflows support workflow_dispatch for manual triggering when needed:
- Go to Actions tab
- Select the workflow
- Click Run workflow
- Choose branch and click Run workflow
This is useful for: - Testing after fixing issues - Running tests on demand - Debugging workflow issues