This directory contains CI/CD workflows for TaylorTorch.
Purpose: Build and test on macOS
- Runs on: Push to main, PRs
- Platform: macOS-14 with Xcode
- Tests: Full test suite
Purpose: Build and test on Linux using Docker
- Runs on: Push to main, PRs
- Platform: Docker container with Swift nightly and PyTorch pre-installed
- Container:
ghcr.io/pedronahum/taylortorch:latest - Tests: Full test suite with LLVM/libc++ support
- Speed: ~5-10 minutes (vs ~45-60 min with full build)
Purpose: Build and publish the Docker container for Ubuntu CI
- Runs on: Dockerfile changes, manual trigger
- Builds: Swift nightly + PyTorch from source
- Pushes to: GitHub Container Registry
- Build time: ~30-45 minutes
Purpose: Automatically deploy documentation to GitHub Pages
- Runs on: Push to main (when docs change), manual trigger
- Platform: macOS-14 with Swift 5.9
- Output: Static HTML documentation at
https://pedronahum.github.io/TaylorTorch/
| Workflow | Status | Purpose |
|---|---|---|
| macOS CI | Build & test on macOS | |
| Ubuntu CI | Build & test on Linux | |
| Deploy DocC | Documentation deployment |
Automatic triggers:
- Push to
mainbranch - Pull requests to
main - Documentation changes (DocC only)
Manual trigger:
- Go to Actions
- Select workflow
- Click "Run workflow"
- Create
.ymlfile in this directory - Define workflow:
name: My Workflow on: [push, pull_request] jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Run something run: echo "Hello!"
- Commit and push
Required for DocC deployment:
- Settings → Actions → General → Workflow permissions
- Select: Read and write permissions
- Find available snapshots at swift.org downloads
- Edit
DockerfileARG variables (lines 10-11):ARG SWIFT_SNAPSHOT_URL="https://download.swift.org/development/ubuntu2404/swift-DEVELOPMENT-SNAPSHOT-YYYY-MM-DD-a/swift-DEVELOPMENT-SNAPSHOT-YYYY-MM-DD-a-ubuntu24.04.tar.gz" ARG SWIFT_VERSION="swift-DEVELOPMENT-SNAPSHOT-YYYY-MM-DD-a"
- Push to trigger
build-docker.yml - Wait for new image to be built (~30-45 min)
ubuntu-ci.ymlwill automatically use the updated image
URL format examples:
- Ubuntu 24.04:
https://download.swift.org/development/ubuntu2404/swift-DEVELOPMENT-SNAPSHOT-2025-10-02-a/swift-DEVELOPMENT-SNAPSHOT-2025-10-02-a-ubuntu24.04.tar.gz - Ubuntu 22.04:
https://download.swift.org/development/ubuntu2204/swift-DEVELOPMENT-SNAPSHOT-2025-10-02-a/swift-DEVELOPMENT-SNAPSHOT-2025-10-02-a-ubuntu22.04.tar.gz - Ubuntu 20.04:
https://download.swift.org/development/ubuntu2004/swift-DEVELOPMENT-SNAPSHOT-2025-10-02-a/swift-DEVELOPMENT-SNAPSHOT-2025-10-02-a-ubuntu20.04.tar.gz
Current Swift version: swift-DEVELOPMENT-SNAPSHOT-2025-10-02-a on Ubuntu 24.04
- Edit
PYTORCH_VERSION(line 13) inDockerfile - Push to trigger
build-docker.yml - Wait for PyTorch to rebuild (~30-45 min)
# Build the image
docker build -t taylortorch-dev .
# Run interactive shell
docker run -it taylortorch-dev /bin/bash
# Test Swift and PyTorch
docker run -it taylortorch-dev swift --version
docker run -it taylortorch-dev ls -lh /opt/pytorch/libSee GITHUB_PAGES_SETUP.md for complete setup instructions.
Quick setup:
- Enable GitHub Pages: Settings → Pages → Source: GitHub Actions
- Push workflow to main branch
- Wait 2-5 minutes for deployment
- Access docs at:
https://pedronahum.github.io/TaylorTorch/
- Check the logs in Actions tab
- Look for red ❌ icons
- Common issues:
- Missing dependencies
- Permission errors
- Syntax errors in YAML
- Verify GitHub Pages is enabled (Settings → Pages)
- Check workflow permissions (Settings → Actions)
- Re-run the failed job
- Run tests locally first:
swift test - Check for platform-specific issues
- Review test logs in Actions tab
Full Ubuntu CI workflow that builds everything from scratch:
- Installs Swift via Swiftly
- Builds PyTorch from source every run
- Uses GitHub Actions caching
- Runs on ubuntu-24.04 (no Docker)
- Build time: ~45-60 minutes
Why it's backed up:
- Reference for debugging environment issues
- Shows exact dependency installation steps
- Useful for adapting to new platforms
- Template for updating Docker container
To use this approach:
- Copy to
ubuntu-ci.yml - Remove header comments
- Restore original job name
| Aspect | Docker (Current) | Full Build (Backup) |
|---|---|---|
| CI Run Time | ~5-10 min | ~45-60 min |
| Setup | Pull pre-built image | Install everything |
| Consistency | Very high | Medium |
| Debugging | Check Docker build | All steps visible |
| Maintenance | Update Dockerfile | Update workflow |
| First Run | Need Docker image | Works immediately |
- Keep workflows fast: Use Docker for complex dependencies
- Test locally first: Don't rely on CI to catch basic errors
- Use matrix builds: Test on multiple platforms/versions
- Fail fast: Stop on first error to save resources
- Cache Docker layers: Speed up container builds
Last Updated: 2025-10-28 Workflows: 4 active (macOS CI, Ubuntu CI, Build Docker, Deploy DocC) Backups: 1 reference file Documentation: Ready for deployment 🚀