|
| 1 | +# GitHub Actions Workflows Quick Reference |
| 2 | + |
| 3 | +This document provides a quick reference for the GitHub Actions workflows in this repository. |
| 4 | + |
| 5 | +## Workflows Overview |
| 6 | + |
| 7 | +| Workflow | File | Triggers | Purpose | |
| 8 | +|----------|------|----------|---------| |
| 9 | +| Build & Test | `build.yml` | PR, Push to main/release | Validate code changes | |
| 10 | +| Publish to Maven | `publish.yml` | Push to main/release, Manual | Deploy SNAPSHOT artifacts | |
| 11 | +| CodeQL | `codeql.yml` | PR, Push, Schedule | Security analysis | |
| 12 | +| Project Management | `project.yml` | Issues, PR events | Automate issue tracking | |
| 13 | + |
| 14 | +## Build & Test Workflow |
| 15 | + |
| 16 | +### When it runs |
| 17 | +- On pull requests to `main` or release branches (`X.X.x`) |
| 18 | +- On pushes to `main` or release branches |
| 19 | + |
| 20 | +### What it does |
| 21 | +1. Checks out code |
| 22 | +2. Sets up Java 17 (Temurin) |
| 23 | +3. Starts FalkorDB service (port 6379) |
| 24 | +4. Runs Maven build with tests and checkstyle |
| 25 | +5. Uploads test results |
| 26 | +6. Publishes test report |
| 27 | + |
| 28 | +### Environment |
| 29 | +- **Java**: 17 |
| 30 | +- **Maven**: Via wrapper |
| 31 | +- **FalkorDB**: Latest (Docker service) |
| 32 | + |
| 33 | +### Required Secrets |
| 34 | +None |
| 35 | + |
| 36 | +### Configuration |
| 37 | +Modify `build.yml` to: |
| 38 | +- Change Java version: Update `java-version` in setup-java step |
| 39 | +- Adjust FalkorDB version: Update `image` in services section |
| 40 | +- Customize Maven goals: Edit `run` in "Build with Maven" step |
| 41 | + |
| 42 | +## Publish to Maven Workflow |
| 43 | + |
| 44 | +### When it runs |
| 45 | +- On pushes to `main` or release branches |
| 46 | +- Manually via workflow_dispatch |
| 47 | + |
| 48 | +### What it does |
| 49 | +1. Checks out code |
| 50 | +2. Sets up Java 17 (Temurin) |
| 51 | +3. Starts FalkorDB service for tests |
| 52 | +4. Builds and deploys to Maven repository |
| 53 | +5. Uploads build artifacts |
| 54 | + |
| 55 | +### Environment |
| 56 | +- **Java**: 17 |
| 57 | +- **Maven**: Via wrapper with settings.xml |
| 58 | +- **FalkorDB**: Latest (Docker service) |
| 59 | + |
| 60 | +### Required Secrets |
| 61 | +- `ARTIFACTORY_USERNAME` - Maven repository username |
| 62 | +- `ARTIFACTORY_PASSWORD` - Maven repository password/token |
| 63 | + |
| 64 | +### Configuration |
| 65 | +Modify `publish.yml` to: |
| 66 | +- Change deployment target: Update `settings.xml` in project root |
| 67 | +- Adjust artifact retention: Change `retention-days` in Upload Artifacts step |
| 68 | +- Customize Maven goals: Edit `run` in "Build and Deploy" step |
| 69 | + |
| 70 | +## Manual Workflow Dispatch |
| 71 | + |
| 72 | +To manually trigger the Publish workflow: |
| 73 | + |
| 74 | +1. Go to Actions tab in GitHub |
| 75 | +2. Select "Publish to Maven" workflow |
| 76 | +3. Click "Run workflow" |
| 77 | +4. Select branch (usually `main`) |
| 78 | +5. Click "Run workflow" button |
| 79 | + |
| 80 | +## Workflow Status |
| 81 | + |
| 82 | +View workflow status at: |
| 83 | +- Repository Actions tab: `https://github.com/FalkorDB/spring-data-falkordb/actions` |
| 84 | +- Pull requests: Status checks section |
| 85 | +- Commits: Commit status icons |
| 86 | + |
| 87 | +## Troubleshooting |
| 88 | + |
| 89 | +### Build Failures |
| 90 | + |
| 91 | +**Problem**: Tests fail with "Connection refused" to FalkorDB |
| 92 | +- **Cause**: FalkorDB service not ready |
| 93 | +- **Solution**: Health check should handle this automatically; if persists, increase health check retries in workflow |
| 94 | + |
| 95 | +**Problem**: Maven dependency resolution fails |
| 96 | +- **Cause**: Network issues or repository unavailable |
| 97 | +- **Solution**: Retry the workflow; GitHub Actions will use cached dependencies if available |
| 98 | + |
| 99 | +**Problem**: Checkstyle failures |
| 100 | +- **Cause**: Code style violations |
| 101 | +- **Solution**: Run `./mvnw spring-javaformat:apply` locally to fix formatting |
| 102 | + |
| 103 | +### Publish Failures |
| 104 | + |
| 105 | +**Problem**: Authentication error deploying to Maven repository |
| 106 | +- **Cause**: Missing or incorrect secrets |
| 107 | +- **Solution**: Verify `ARTIFACTORY_USERNAME` and `ARTIFACTORY_PASSWORD` secrets in repository settings |
| 108 | + |
| 109 | +**Problem**: "Version already exists" error |
| 110 | +- **Cause**: Trying to publish non-SNAPSHOT version |
| 111 | +- **Solution**: This workflow only publishes SNAPSHOT versions; use a release workflow for releases |
| 112 | + |
| 113 | +## Best Practices |
| 114 | + |
| 115 | +### For Contributors |
| 116 | + |
| 117 | +1. **Before opening PR**: Run `./mvnw clean verify` locally |
| 118 | +2. **Fix issues quickly**: CI failures block merging |
| 119 | +3. **Check test reports**: Review failed tests in Actions tab |
| 120 | +4. **Keep PRs focused**: Smaller PRs are easier to review and test |
| 121 | + |
| 122 | +### For Maintainers |
| 123 | + |
| 124 | +1. **Monitor workflow runs**: Check Actions tab regularly |
| 125 | +2. **Update secrets**: Rotate credentials periodically |
| 126 | +3. **Review dependencies**: Update action versions in workflows |
| 127 | +4. **Cache management**: Clear caches if build issues persist |
| 128 | + |
| 129 | +## Workflow Files Location |
| 130 | + |
| 131 | +All workflow files are in `.github/workflows/`: |
| 132 | +``` |
| 133 | +.github/workflows/ |
| 134 | +├── build.yml # Build & Test |
| 135 | +├── publish.yml # Publish to Maven |
| 136 | +├── codeql.yml # CodeQL security scan |
| 137 | +└── project.yml # Project management |
| 138 | +``` |
| 139 | + |
| 140 | +## Related Documentation |
| 141 | + |
| 142 | +- [CI README](../ci/README.md) - Detailed CI/CD documentation |
| 143 | +- [Contributing Guide](../README.md#-contributing) - How to contribute |
| 144 | +- [Maven Documentation](https://maven.apache.org/) - Maven reference |
| 145 | +- [GitHub Actions Docs](https://docs.github.com/actions) - GitHub Actions reference |
| 146 | + |
| 147 | +## Getting Help |
| 148 | + |
| 149 | +- Open an issue in the repository |
| 150 | +- Check the Actions tab for workflow run logs |
| 151 | +- Review the CI README for troubleshooting steps |
| 152 | +- Contact maintainers via email or Discord |
0 commit comments