Home | History | Annotate | Line # | Download | only in scripts
README_GH_ACTIONS.md revision 1.1.1.1
      1  1.1  christos # GitHub Actions Workflow Generator
      2  1.1  christos 
      3  1.1  christos This directory contains `gen_gh_actions.py`, a script to generate GitHub Actions CI workflows from the same configuration logic used for Travis CI.
      4  1.1  christos 
      5  1.1  christos ## Usage
      6  1.1  christos 
      7  1.1  christos The script can generate workflows for different platforms:
      8  1.1  christos 
      9  1.1  christos ```bash
     10  1.1  christos # Generate Linux CI workflow (default)
     11  1.1  christos ./scripts/gen_gh_actions.py linux > .github/workflows/linux-ci.yml
     12  1.1  christos 
     13  1.1  christos # Generate macOS CI workflow
     14  1.1  christos ./scripts/gen_gh_actions.py macos > .github/workflows/macos-ci.yml
     15  1.1  christos 
     16  1.1  christos # Generate Windows CI workflow
     17  1.1  christos ./scripts/gen_gh_actions.py windows > .github/workflows/windows-ci.yml
     18  1.1  christos 
     19  1.1  christos # Generate FreeBSD CI workflow
     20  1.1  christos ./scripts/gen_gh_actions.py freebsd > .github/workflows/freebsd-ci.yml
     21  1.1  christos 
     22  1.1  christos # Generate combined workflow with all platforms
     23  1.1  christos ./scripts/gen_gh_actions.py all > .github/workflows/ci-all.yml
     24  1.1  christos ```
     25  1.1  christos 
     26  1.1  christos ## Generated Workflows
     27  1.1  christos 
     28  1.1  christos ### Linux CI (`linux-ci.yml`)
     29  1.1  christos - **test-linux** (AMD64): `ubuntu-latest` (x86_64)
     30  1.1  christos   - ~96 configurations covering GCC, Clang, various flags
     31  1.1  christos - **test-linux-arm64** (ARM64): `ubuntu-24.04-arm` (aarch64)
     32  1.1  christos   - ~14 configurations including large hugepage tests
     33  1.1  christos   - **Note:** Free ARM64 runners (Public Preview) - may have longer queue times during peak hours
     34  1.1  christos 
     35  1.1  christos **Total:** 110 configurations
     36  1.1  christos 
     37  1.1  christos ### macOS CI (`macos-ci.yml`)
     38  1.1  christos - **test-macos** (Intel): `macos-15-intel` (x86_64)
     39  1.1  christos   - ~10 configurations with GCC compiler
     40  1.1  christos - **test-macos-arm64** (Apple Silicon): `macos-latest` (arm64)
     41  1.1  christos   - ~11 configurations including large hugepage tests
     42  1.1  christos 
     43  1.1  christos **Total:** 21 configurations
     44  1.1  christos 
     45  1.1  christos ### Windows CI (`windows-ci.yml`)
     46  1.1  christos - **test-windows** (AMD64): `windows-latest` (x86_64)
     47  1.1  christos   - 10 configurations covering MinGW-GCC and MSVC compilers
     48  1.1  christos   - 32-bit and 64-bit builds
     49  1.1  christos   - Uses MSYS2 for build environment
     50  1.1  christos 
     51  1.1  christos **Total:** 10 configurations
     52  1.1  christos 
     53  1.1  christos ### FreeBSD CI (`freebsd-ci.yml`)
     54  1.1  christos - **test-freebsd** (AMD64): Runs in FreeBSD VM on `ubuntu-latest`
     55  1.1  christos   - Matrix testing: debug (on/off), prof (on/off), arch (32/64-bit), uncommon configs
     56  1.1  christos   - 16 total configuration combinations
     57  1.1  christos   - Uses FreeBSD 15.0 via `vmactions/freebsd-vm@v1`
     58  1.1  christos   - Uses `gmake` (GNU Make) instead of BSD make
     59  1.1  christos 
     60  1.1  christos **Total:** 16 configurations
     61  1.1  christos 
     62  1.1  christos ## Architecture Verification
     63  1.1  christos 
     64  1.1  christos Each workflow includes a "Show OS version" step that prints:
     65  1.1  christos 
     66  1.1  christos **Linux:**
     67  1.1  christos ```bash
     68  1.1  christos === System Information ===
     69  1.1  christos uname -a              # Kernel and architecture
     70  1.1  christos === Architecture ===
     71  1.1  christos uname -m              # x86_64, aarch64, etc.
     72  1.1  christos arch                 # Architecture type
     73  1.1  christos === CPU Info ===
     74  1.1  christos lscpu                # Detailed CPU information
     75  1.1  christos ```
     76  1.1  christos 
     77  1.1  christos **macOS:**
     78  1.1  christos ```bash
     79  1.1  christos === macOS Version ===
     80  1.1  christos sw_vers              # macOS version and build
     81  1.1  christos === Architecture ===
     82  1.1  christos uname -m             # x86_64 or arm64
     83  1.1  christos arch                # i386 or arm64
     84  1.1  christos === CPU Info ===
     85  1.1  christos sysctl machdep.cpu.brand_string  # CPU model
     86  1.1  christos ```
     87  1.1  christos 
     88  1.1  christos **Windows:**
     89  1.1  christos ```cmd
     90  1.1  christos === Windows Version ===
     91  1.1  christos systeminfo           # OS name and version
     92  1.1  christos ver                 # Windows version
     93  1.1  christos === Architecture ===
     94  1.1  christos PROCESSOR_ARCHITECTURE  # AMD64, x86, ARM64
     95  1.1  christos ```
     96  1.1  christos 
     97  1.1  christos ## GitHub Runner Images
     98  1.1  christos 
     99  1.1  christos | Platform | Runner Label | Architecture | OS Version | Strategy |
    100  1.1  christos |----------|--------------|--------------|------------|----------|
    101  1.1  christos | Linux AMD64 | ubuntu-latest | x86_64 | Ubuntu 22.04+ | Auto-update |
    102  1.1  christos | Linux ARM64 | ubuntu-24.04-arm | aarch64 | Ubuntu 24.04 | Free (Public Preview) |
    103  1.1  christos | macOS Intel | macos-15-intel | x86_64 | macOS 15 Sequoia | Pinned |
    104  1.1  christos | macOS Apple Silicon | macos-15 | arm64 | macOS 15 Sequoia | Pinned |
    105  1.1  christos | Windows | windows-latest | x86_64 | Windows Server 2022+ | Auto-update |
    106  1.1  christos | FreeBSD | ubuntu-latest (VM) | x86_64 | FreeBSD 15.0 in VM | VM-based |
    107  1.1  christos 
    108  1.1  christos ### Runner Strategy Explained
    109  1.1  christos 
    110  1.1  christos We use a **hybrid approach** to balance stability and maintenance:
    111  1.1  christos 
    112  1.1  christos **Auto-update runners (`-latest`):**
    113  1.1  christos - **Linux AMD64**: `ubuntu-latest` - Very stable, rarely breaks, auto-updates to newest Ubuntu LTS
    114  1.1  christos - **Windows**: `windows-latest` - Backward compatible, auto-updates to newest Windows Server
    115  1.1  christos 
    116  1.1  christos **Pinned runners (specific versions):**
    117  1.1  christos - **Linux ARM64**: `ubuntu-24.04-arm` - **Free for public repos** (Public Preview, may have queue delays)
    118  1.1  christos - **macOS Intel**: `macos-15-intel` - Last Intel macOS runner (EOL **August 2027**)
    119  1.1  christos - **macOS Apple Silicon**: `macos-15` - Pin for control over macOS upgrades
    120  1.1  christos 
    121  1.1  christos **Why this approach?**
    122  1.1  christos -  Reduces maintenance (auto-update where safe)
    123  1.1  christos -  Prevents surprise breakages (pin where needed)
    124  1.1  christos -  Balances stability and staying current
    125  1.1  christos -  Uses free ARM64 runners for public repositories
    126  1.1  christos 
    127  1.1  christos ### ARM64 Queue Times
    128  1.1  christos 
    129  1.1  christos **If you experience long waits for ARM64 jobs:**
    130  1.1  christos 
    131  1.1  christos The `ubuntu-24.04-arm` runner is **free for public repositories** but is in **Public Preview**. GitHub warns: *"you may experience longer queue times during peak usage hours"*.
    132  1.1  christos 
    133  1.1  christos To reduce wait times we should upgrade to Team/Enterprise plan - then we could use `ubuntu-24.04-arm64` for faster, paid runners
    134  1.1  christos 
    135  1.1  christos ### Important Deprecation Timeline
    136  1.1  christos 
    137  1.1  christos | Date | Event | Action Required |
    138  1.1  christos |------|-------|------------------|
    139  1.1  christos | **August 2027** | macOS Intel runners removed | Must drop Intel macOS testing or use self-hosted |
    140  1.1  christos | **TBD** | ARM64 runners leave Public Preview | May see improved queue times |
    141  1.1  christos 
    142  1.1  christos **Note:** `macos-15-intel` is the **last Intel-based macOS runner** from GitHub Actions. After August 2027, only Apple Silicon runners will be available.
    143  1.1  christos 
    144  1.1  christos ## Platform-Specific Details
    145  1.1  christos 
    146  1.1  christos ### Windows Build Process
    147  1.1  christos The Windows workflow uses:
    148  1.1  christos 1. **MSYS2** setup via `msys2/setup-msys2@v2` action
    149  1.1  christos 2. **MinGW-GCC**: Standard autotools build process in MSYS2 shell
    150  1.1  christos 3. **MSVC (cl.exe)**: Requires `ilammy/msvc-dev-cmd@v1` for environment setup
    151  1.1  christos    - Uses `MSYS2_PATH_TYPE: inherit` to inherit Windows PATH
    152  1.1  christos    - Exports `AR=lib.exe`, `NM=dumpbin.exe`, `RANLIB=:`
    153  1.1  christos 4. **mingw32-make**: Used instead of `make` (standard in MSYS2)
    154  1.1  christos 
    155  1.1  christos ### macOS Build Process
    156  1.1  christos - Uses Homebrew to install `autoconf`
    157  1.1  christos - Tests on both Intel (x86_64) and Apple Silicon (ARM64)
    158  1.1  christos - Standard autotools build process
    159  1.1  christos - Excludes certain malloc configurations not supported on macOS
    160  1.1  christos 
    161  1.1  christos ### Linux Build Process
    162  1.1  christos - Ubuntu Latest for AMD64, Ubuntu 24.04 for ARM64
    163  1.1  christos - Installs 32-bit cross-compilation dependencies when needed
    164  1.1  christos - Most comprehensive test matrix (110 configurations)
    165  1.1  christos 
    166  1.1  christos ## Relationship to Travis CI
    167  1.1  christos 
    168  1.1  christos This script mirrors the logic from `gen_travis.py` but generates GitHub Actions workflows instead of `.travis.yml`. The test matrices are designed to provide equivalent coverage to the Travis CI configuration.
    169  1.1  christos 
    170  1.1  christos ## Regenerating Workflows
    171  1.1  christos 
    172  1.1  christos To regenerate all workflows after modifying `gen_gh_actions.py`:
    173  1.1  christos 
    174  1.1  christos ```bash
    175  1.1  christos ./scripts/gen_gh_actions.py linux > .github/workflows/linux-ci.yml
    176  1.1  christos ./scripts/gen_gh_actions.py macos > .github/workflows/macos-ci.yml
    177  1.1  christos ./scripts/gen_gh_actions.py windows > .github/workflows/windows-ci.yml
    178  1.1  christos ```
    179  1.1  christos 
    180  1.1  christos **Note**: The generated files should not be edited by hand. All changes should be made to `gen_gh_actions.py` and then regenerated.
    181  1.1  christos 
    182