mirror of
https://github.com/Z3Prover/z3
synced 2026-03-12 08:10:32 +00:00
Fix workflow compilation errors and relocate documentation files (#8295)
* Initial plan * Fix workflow compilation errors and recompile all workflows - Fixed code-conventions-analyzer.md: changed missing-tool.create-pull-request to create-issue - Moved documentation files (CI_MIGRATION.md, CI_TESTING.md, NUGET_BUILD_README.md) from .github/workflows/ to .github/ - Recompiled all workflows successfully - All .lock.yml files regenerated Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
This commit is contained in:
parent
995e8c6555
commit
50157d400a
9 changed files with 8 additions and 10 deletions
123
.github/workflows/CI_MIGRATION.md
vendored
123
.github/workflows/CI_MIGRATION.md
vendored
|
|
@ -1,123 +0,0 @@
|
|||
# Azure Pipelines to GitHub Actions Migration
|
||||
|
||||
## Overview
|
||||
|
||||
This document describes the migration from Azure Pipelines (`azure-pipelines.yml`) to GitHub Actions (`.github/workflows/ci.yml`).
|
||||
|
||||
## Migration Summary
|
||||
|
||||
All jobs from the Azure Pipelines configuration have been migrated to GitHub Actions with equivalent or improved functionality.
|
||||
|
||||
### Jobs Migrated
|
||||
|
||||
| Azure Pipelines Job | GitHub Actions Job | Status |
|
||||
|---------------------|-------------------|--------|
|
||||
| LinuxPythonDebug (MT) | linux-python-debug (MT) | ✅ Migrated |
|
||||
| LinuxPythonDebug (ST) | linux-python-debug (ST) | ✅ Migrated |
|
||||
| ManylinuxPythonBuildAmd64 | manylinux-python-amd64 | ✅ Migrated |
|
||||
| ManyLinuxPythonBuildArm64 | manylinux-python-arm64 | ✅ Migrated |
|
||||
| UbuntuOCaml | ubuntu-ocaml | ✅ Migrated |
|
||||
| UbuntuOCamlStatic | ubuntu-ocaml-static | ✅ Migrated |
|
||||
| UbuntuCMake (releaseClang) | ubuntu-cmake (releaseClang) | ✅ Migrated |
|
||||
| UbuntuCMake (debugClang) | ubuntu-cmake (debugClang) | ✅ Migrated |
|
||||
| UbuntuCMake (debugGcc) | ubuntu-cmake (debugGcc) | ✅ Migrated |
|
||||
| UbuntuCMake (releaseSTGcc) | ubuntu-cmake (releaseSTGcc) | ✅ Migrated |
|
||||
| MacOSPython | macos-python | ✅ Migrated |
|
||||
| MacOSCMake | macos-cmake | ✅ Migrated |
|
||||
| LinuxMSan | N/A | ⚠️ Was disabled (condition: eq(0,1)) |
|
||||
| MacOSOCaml | N/A | ⚠️ Was disabled (condition: eq(0,1)) |
|
||||
|
||||
## Key Differences
|
||||
|
||||
### Syntax Changes
|
||||
|
||||
1. **Trigger Configuration**
|
||||
- Azure: `jobs:` with implicit triggers
|
||||
- GitHub: Explicit `on:` section with `push`, `pull_request`, and `workflow_dispatch`
|
||||
|
||||
2. **Job Names**
|
||||
- Azure: `displayName` field
|
||||
- GitHub: `name` field
|
||||
|
||||
3. **Steps**
|
||||
- Azure: `script:` for shell commands
|
||||
- GitHub: `run:` for shell commands
|
||||
|
||||
4. **Checkout**
|
||||
- Azure: Implicit checkout
|
||||
- GitHub: Explicit `uses: actions/checkout@v4`
|
||||
|
||||
5. **Python Setup**
|
||||
- Azure: Implicit Python availability
|
||||
- GitHub: Explicit `uses: actions/setup-python@v5`
|
||||
|
||||
6. **Variables**
|
||||
- Azure: Top-level `variables:` section
|
||||
- GitHub: Inline in job steps or matrix configuration
|
||||
|
||||
### Template Scripts
|
||||
|
||||
Azure Pipelines used external template files (e.g., `scripts/test-z3.yml`, `scripts/test-regressions.yml`). These have been inlined into the GitHub Actions workflow:
|
||||
|
||||
- `scripts/test-z3.yml`: Unit tests → Inlined as "Run unit tests" step
|
||||
- `scripts/test-regressions.yml`: Regression tests → Inlined as "Run regressions" step
|
||||
- `scripts/test-examples-cmake.yml`: CMake examples → Inlined as "Run examples" step
|
||||
- `scripts/generate-doc.yml`: Documentation → Inlined as "Generate documentation" step
|
||||
|
||||
### Matrix Strategies
|
||||
|
||||
Both Azure Pipelines and GitHub Actions support matrix builds. The migration maintains the same matrix configurations:
|
||||
|
||||
- **linux-python-debug**: 2 variants (MT, ST)
|
||||
- **ubuntu-cmake**: 4 variants (releaseClang, debugClang, debugGcc, releaseSTGcc)
|
||||
|
||||
### Container Jobs
|
||||
|
||||
Manylinux builds continue to use container images:
|
||||
- `quay.io/pypa/manylinux_2_34_x86_64:latest` for AMD64
|
||||
- `quay.io/pypa/manylinux2014_x86_64:latest` for ARM64 cross-compilation
|
||||
|
||||
### Disabled Jobs
|
||||
|
||||
Two jobs were disabled in Azure Pipelines (with `condition: eq(0,1)`) and have not been migrated:
|
||||
- **LinuxMSan**: Memory sanitizer builds
|
||||
- **MacOSOCaml**: macOS OCaml builds
|
||||
|
||||
These can be re-enabled in the future if needed by adding them to the workflow file.
|
||||
|
||||
## Benefits of GitHub Actions
|
||||
|
||||
1. **Unified Platform**: All CI/CD in one place (GitHub)
|
||||
2. **Better Integration**: Native integration with GitHub features (checks, status, etc.)
|
||||
3. **Actions Marketplace**: Access to pre-built actions
|
||||
4. **Improved Caching**: Better artifact and cache management
|
||||
5. **Cost**: Free for public repositories
|
||||
|
||||
## Testing
|
||||
|
||||
To test the new workflow:
|
||||
|
||||
1. Push a branch or create a pull request
|
||||
2. The workflow will automatically trigger
|
||||
3. Monitor progress in the "Actions" tab
|
||||
4. Review job logs for any issues
|
||||
|
||||
## Deprecation Plan
|
||||
|
||||
1. ✅ Create new GitHub Actions workflow (`.github/workflows/ci.yml`)
|
||||
2. 🔄 Test and validate the new workflow
|
||||
3. ⏳ Run both pipelines in parallel for a transition period
|
||||
4. ⏳ Once stable, deprecate `azure-pipelines.yml`
|
||||
|
||||
## Rollback Plan
|
||||
|
||||
If issues arise with the GitHub Actions workflow:
|
||||
1. The original `azure-pipelines.yml` remains in the repository
|
||||
2. Azure Pipelines can be re-enabled if needed
|
||||
3. Both can run in parallel during the transition
|
||||
|
||||
## Additional Resources
|
||||
|
||||
- [GitHub Actions Documentation](https://docs.github.com/en/actions)
|
||||
- [Migrating from Azure Pipelines to GitHub Actions](https://docs.github.com/en/actions/migrating-to-github-actions/migrating-from-azure-pipelines-to-github-actions)
|
||||
- [GitHub Actions Syntax Reference](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions)
|
||||
132
.github/workflows/CI_TESTING.md
vendored
132
.github/workflows/CI_TESTING.md
vendored
|
|
@ -1,132 +0,0 @@
|
|||
# Testing the CI Workflow
|
||||
|
||||
This document provides instructions for testing the new GitHub Actions CI workflow after migration from Azure Pipelines.
|
||||
|
||||
## Quick Test
|
||||
|
||||
To test the workflow:
|
||||
|
||||
1. **Push a branch or create a PR**: The workflow automatically triggers on all branches
|
||||
2. **View workflow runs**: Go to the "Actions" tab in GitHub
|
||||
3. **Monitor progress**: Click on a workflow run to see job details
|
||||
|
||||
## Manual Trigger
|
||||
|
||||
You can also manually trigger the workflow:
|
||||
|
||||
1. Go to the "Actions" tab
|
||||
2. Select "CI" from the left sidebar
|
||||
3. Click "Run workflow"
|
||||
4. Choose your branch
|
||||
5. Click "Run workflow"
|
||||
|
||||
## Local Validation
|
||||
|
||||
Before pushing, you can validate the YAML syntax locally:
|
||||
|
||||
```bash
|
||||
# Using yamllint (install with: pip install yamllint)
|
||||
yamllint .github/workflows/ci.yml
|
||||
|
||||
# Using Python PyYAML
|
||||
python3 -c "import yaml; yaml.safe_load(open('.github/workflows/ci.yml'))"
|
||||
|
||||
# Using actionlint (install from https://github.com/rhysd/actionlint)
|
||||
actionlint .github/workflows/ci.yml
|
||||
```
|
||||
|
||||
## Job Matrix
|
||||
|
||||
The CI workflow includes these job categories:
|
||||
|
||||
### Linux Jobs
|
||||
- **linux-python-debug**: Python-based build with make (MT and ST variants)
|
||||
- **manylinux-python-amd64**: Python wheel build for manylinux AMD64
|
||||
- **manylinux-python-arm64**: Python wheel build for manylinux ARM64 (cross-compile)
|
||||
- **ubuntu-ocaml**: OCaml bindings build
|
||||
- **ubuntu-ocaml-static**: OCaml static library build
|
||||
- **ubuntu-cmake**: CMake builds with multiple compilers (4 variants)
|
||||
|
||||
### macOS Jobs
|
||||
- **macos-python**: Python-based build with make
|
||||
- **macos-cmake**: CMake build with Julia support
|
||||
|
||||
## Expected Runtime
|
||||
|
||||
Approximate job durations:
|
||||
- Linux Python builds: 20-30 minutes
|
||||
- Manylinux Python builds: 15-25 minutes
|
||||
- OCaml builds: 25-35 minutes
|
||||
- CMake builds: 25-35 minutes each variant
|
||||
- macOS builds: 30-40 minutes
|
||||
|
||||
Total workflow time (all jobs in parallel): ~40-60 minutes
|
||||
|
||||
## Debugging Failed Jobs
|
||||
|
||||
If a job fails:
|
||||
|
||||
1. **Click on the failed job** to see the log
|
||||
2. **Expand failed steps** to see detailed output
|
||||
3. **Check for common issues**:
|
||||
- Missing dependencies
|
||||
- Test failures
|
||||
- Build errors
|
||||
- Timeout (increase timeout-minutes if needed)
|
||||
|
||||
4. **Re-run failed jobs**:
|
||||
- Click "Re-run failed jobs" button
|
||||
- Or "Re-run all jobs" to test everything
|
||||
|
||||
## Comparing with Azure Pipelines
|
||||
|
||||
To compare results:
|
||||
|
||||
1. Check the last successful Azure Pipelines run
|
||||
2. Compare job names and steps with the GitHub Actions workflow
|
||||
3. Verify all tests pass with similar coverage
|
||||
|
||||
## Differences from Azure Pipelines
|
||||
|
||||
1. **Checkout**: Explicit `actions/checkout@v4` step (was implicit)
|
||||
2. **Python Setup**: Explicit `actions/setup-python@v5` step (was implicit)
|
||||
3. **Template Files**: Inlined instead of external templates
|
||||
4. **Artifacts**: Uses `actions/upload-artifact` (if needed in future)
|
||||
5. **Caching**: Can add `actions/cache` for dependencies (optional optimization)
|
||||
|
||||
## Adding Jobs or Modifying
|
||||
|
||||
To add or modify jobs:
|
||||
|
||||
1. Edit `.github/workflows/ci.yml`
|
||||
2. Follow the existing job structure
|
||||
3. Use matrix strategy for variants
|
||||
4. Add appropriate timeouts (default: 90 minutes)
|
||||
5. Test your changes on a branch first
|
||||
|
||||
## Optimization Opportunities
|
||||
|
||||
Future optimizations to consider:
|
||||
|
||||
1. **Caching**: Add dependency caching (npm, pip, opam, etc.)
|
||||
2. **Artifacts**: Share build artifacts between jobs
|
||||
3. **Concurrency**: Add concurrency groups to cancel outdated runs
|
||||
4. **Selective Execution**: Skip jobs based on changed files
|
||||
5. **Self-hosted Runners**: For faster builds (if available)
|
||||
|
||||
## Rollback Plan
|
||||
|
||||
If the GitHub Actions workflow has issues:
|
||||
|
||||
1. The original `azure-pipelines.yml` is still in the repository
|
||||
2. Azure Pipelines can be re-enabled if needed
|
||||
3. Both systems can run in parallel during transition
|
||||
|
||||
## Support
|
||||
|
||||
For issues or questions:
|
||||
|
||||
1. Check GitHub Actions documentation: https://docs.github.com/en/actions
|
||||
2. Review the migration document: `.github/workflows/CI_MIGRATION.md`
|
||||
3. Check existing GitHub Actions workflows in `.github/workflows/`
|
||||
4. Open an issue in the repository
|
||||
87
.github/workflows/NUGET_BUILD_README.md
vendored
87
.github/workflows/NUGET_BUILD_README.md
vendored
|
|
@ -1,87 +0,0 @@
|
|||
# NuGet Package Build Workflow
|
||||
|
||||
This document describes the GitHub Actions workflow for building Z3 NuGet packages.
|
||||
|
||||
## Overview
|
||||
|
||||
The NuGet build workflow (`.github/workflows/nuget-build.yml`) creates Microsoft.Z3 NuGet packages for distribution. It builds Z3 for all supported platforms and assembles them into NuGet packages.
|
||||
|
||||
## Triggering the Workflow
|
||||
|
||||
The workflow can be triggered in two ways:
|
||||
|
||||
### 1. Manual Trigger
|
||||
|
||||
You can manually trigger the workflow from the GitHub Actions tab:
|
||||
|
||||
1. Go to the "Actions" tab in the repository
|
||||
2. Select "Build NuGet Package" workflow
|
||||
3. Click "Run workflow"
|
||||
4. Enter the version number (e.g., `4.15.5`)
|
||||
5. Click "Run workflow"
|
||||
|
||||
### 2. Tag-based Trigger
|
||||
|
||||
The workflow automatically runs when you push a tag with the `z3-` prefix:
|
||||
|
||||
```bash
|
||||
git tag z3-4.15.5
|
||||
git push origin z3-4.15.5
|
||||
```
|
||||
|
||||
## Workflow Structure
|
||||
|
||||
The workflow consists of multiple jobs:
|
||||
|
||||
### Build Jobs
|
||||
|
||||
1. **build-windows-x64**: Builds Windows x64 binaries with .NET support
|
||||
2. **build-windows-x86**: Builds Windows x86 binaries with .NET support
|
||||
3. **build-windows-arm64**: Builds Windows ARM64 binaries with .NET support
|
||||
4. **build-ubuntu**: Builds Linux x64 binaries with .NET support
|
||||
5. **build-macos-x64**: Builds macOS x64 binaries with .NET support
|
||||
6. **build-macos-arm64**: Builds macOS ARM64 binaries with .NET support
|
||||
|
||||
### Package Jobs
|
||||
|
||||
1. **package-nuget-x64**: Creates the main NuGet package (Microsoft.Z3.nupkg) with x64, ARM64, Linux, and macOS support
|
||||
2. **package-nuget-x86**: Creates the x86 NuGet package (Microsoft.Z3.x86.nupkg)
|
||||
|
||||
## Output
|
||||
|
||||
The workflow produces two NuGet packages as artifacts:
|
||||
|
||||
- `Microsoft.Z3.{version}.nupkg` and `Microsoft.Z3.{version}.snupkg` (x64 + multi-platform)
|
||||
- `Microsoft.Z3.x86.{version}.nupkg` and `Microsoft.Z3.x86.{version}.snupkg` (x86 only)
|
||||
|
||||
These can be downloaded from the workflow run's artifacts section.
|
||||
|
||||
## Key Files
|
||||
|
||||
- `.github/workflows/nuget-build.yml`: The workflow definition
|
||||
- `scripts/mk_nuget_task.py`: Script that assembles the NuGet package from build artifacts
|
||||
- `scripts/mk_win_dist.py`: Script for building Windows x86/x64 distributions
|
||||
- `scripts/mk_win_dist_cmake.py`: Script for building Windows ARM64 distributions
|
||||
- `scripts/mk_unix_dist.py`: Script for building Linux and macOS distributions
|
||||
|
||||
## Bug Fix
|
||||
|
||||
This workflow includes a fix for a critical bug in `mk_nuget_task.py` where the `replace()` function had incorrect logic that would fail to copy files when the destination already existed. The fix ensures that Microsoft.Z3.dll and related files are always properly included in the NuGet package under `lib/netstandard2.0/`.
|
||||
|
||||
## Development
|
||||
|
||||
To test changes to the NuGet packaging locally, you can:
|
||||
|
||||
1. Build the platform-specific binaries using the appropriate build scripts
|
||||
2. Collect the resulting ZIP files in a directory
|
||||
3. Run `mk_nuget_task.py` to assemble the package:
|
||||
|
||||
```bash
|
||||
python scripts/mk_nuget_task.py <packages_dir> <version> <repo_url> <branch> <commit> <source_dir> [symbols] [x86]
|
||||
```
|
||||
|
||||
4. Use the NuGet CLI to pack the package:
|
||||
|
||||
```bash
|
||||
nuget pack out/Microsoft.Z3.sym.nuspec -OutputDirectory . -Verbosity detailed -Symbols -SymbolPackageFormat snupkg -BasePath out
|
||||
```
|
||||
|
|
@ -27,7 +27,7 @@ safe-outputs:
|
|||
category: "Agentic Workflows"
|
||||
close-older-discussions: true
|
||||
missing-tool:
|
||||
create-pull-request: true
|
||||
create-issue: true
|
||||
network: defaults
|
||||
timeout-minutes: 20
|
||||
---
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue