Guide
Testing in CI
A GitHub Actions workflow that checks formatting, runs the tests on Windows, macOS, and Linux, and builds a release.
This workflow runs on every push and pull request. On each OS it installs FutureBlitz, checks the code is formatted, runs the tests in debug and in release, and builds a release executable.
The workflow
.github/workflows/ci.yml:
name: ci
on:
push:
pull_request:
jobs:
test:
strategy:
fail-fast: false
matrix:
os: [windows-2025, macos-15, ubuntu-24.04]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install FutureBlitz (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
irm https://futureblitz.dev/install.ps1 | iex
"$env:USERPROFILE\.futureblitz\bin" >> $env:GITHUB_PATH
- name: Install FutureBlitz (macOS and Linux)
if: runner.os != 'Windows'
run: |
curl -fsSL https://futureblitz.dev/install.sh | sh
echo "$HOME/.futureblitz/bin" >> "$GITHUB_PATH"
- run: fb --version
- run: fb fmt --check
- run: fb test
- run: fb test --release
- run: fb build --releaseWhat each step does
- The install steps put fb in the runner’s
~/.futureblitz, and itsbinon the job’s PATH, so the steps after it find it. The scripts check the release against itsSHA256SUMSbefore unpacking it, and download it without GitHub’s API, so the API’s rate limit, which runners share, never stops a job. fb fmt --checklists the files that aren’t formatted, and fails the job when there are any. Runfb fmtto fix them.fb testruns every test, in a debug build, where integer overflow panics and leaks are reported.fb test --releaseruns them again, optimized, as the program ships.fb build --releasebuilds the executable for the runner’s OS. Upload it withactions/upload-artifactto keep it.
Keeping it fast
fb keeps downloaded packages in ~/.futureblitz/cache. Caching that folder, keyed on
fb.lock, saves downloading them on every run:
- uses: actions/cache@v4
with:
path: ~/.futureblitz/cache
key: fb-${{ runner.os }}-${{ hashFiles('fb.lock') }}A given version
The install scripts install the latest release. To pin one, set FUTUREBLITZ_VERSION on the
install steps:
env:
FUTUREBLITZ_VERSION: "1.0.0"Report an issue with this page or with FutureBlitz on GitHub.