Skip to content

Fold RPM and DEB repo updates into release workflow, fix dpkg-sig → d… #342

Fold RPM and DEB repo updates into release workflow, fix dpkg-sig → d…

Fold RPM and DEB repo updates into release workflow, fix dpkg-sig → d… #342

Workflow file for this run

name: CI
on:
push:
branches: ['*']
pull_request:
branches: [master, main]
workflow_dispatch:
permissions:
contents: read
jobs:
# ========================================
# Fetch dependencies on Linux using ocicl
# ========================================
fetch-deps:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Install ocicl (Linux)
env:
GH_TOKEN: ${{ github.token }}
run: |
sudo apt-get update
sudo apt-get install -y sbcl
gh release download --repo ocicl/ocicl --pattern '*_amd64.deb' --dir /tmp
sudo dpkg -i /tmp/ocicl_*_amd64.deb
ocicl setup > ~/.sbclrc
- name: Fetch Lisp dependencies
run: ocicl install
- name: Upload ocicl directory
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: ocicl-deps
path: ocicl
retention-days: 1
# ========================================
# Build and test on all platforms
# ========================================
build:
needs: fetch-deps
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
deps: "sudo apt-get update && sudo apt-get install -y sbcl libfixposix-dev build-essential"
binary: icl
- os: macos-latest
deps: "brew install sbcl libfixposix"
binary: icl
- os: windows-latest
deps: "choco install -y sbcl make"
binary: icl.exe
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Download ocicl dependencies
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: ocicl-deps
path: ocicl
- name: Install deps (Linux)
if: runner.os == 'Linux'
env:
DEPS_CMD: ${{ matrix.deps }}
run: eval "$DEPS_CMD"
- name: Install deps (macOS)
if: runner.os == 'macOS'
env:
DEPS_CMD: ${{ matrix.deps }}
run: eval "$DEPS_CMD"
- name: Install deps (Windows)
if: runner.os == 'Windows'
shell: powershell
run: |
choco install -y sbcl make
# Add SBCL to PATH for subsequent bash steps
$sbclPath = (Get-Command sbcl).Source | Split-Path
echo "$sbclPath" | Out-File -Append -Encoding utf8 $env:GITHUB_PATH
- name: Build
run: make
- name: Unit tests
run: make test
- name: Test version
env:
BINARY: ${{ matrix.binary }}
run: ./"$BINARY" --version
- name: Test help
env:
BINARY: ${{ matrix.binary }}
run: ./"$BINARY" --help
- name: Test basic evaluation (Linux)
if: runner.os == 'Linux'
env:
BINARY: ${{ matrix.binary }}
run: |
output=$(printf '(+ 1 2)\n,quit\n' | timeout 30s ./"$BINARY" 2>&1)
echo "$output"
echo "$output" | grep -q "3" || (echo "FAIL: Expected result 3 not found" && exit 1)
- name: Test basic evaluation (macOS)
if: runner.os == 'macOS'
env:
BINARY: ${{ matrix.binary }}
run: |
brew install coreutils
output=$(printf '(+ 1 2)\n,quit\n' | gtimeout 30s ./"$BINARY" 2>&1)
echo "$output"
echo "$output" | grep -q "3" || (echo "FAIL: Expected result 3 not found" && exit 1)
# Skip backend tests on Windows - SBCL/slynk spawning hangs in GitHub Actions
# The --version and --help tests above verify the build works
- name: Test ,info command (Linux)
if: runner.os == 'Linux'
env:
BINARY: ${{ matrix.binary }}
run: |
output=$(printf ',info\n,quit\n' | timeout 30s ./"$BINARY" 2>&1)
echo "$output"
echo "$output" | grep -q "SBCL" || (echo "FAIL: Expected SBCL info not found" && exit 1)
- name: Test ,info command (macOS)
if: runner.os == 'macOS'
env:
BINARY: ${{ matrix.binary }}
run: |
output=$(printf ',info\n,quit\n' | gtimeout 30s ./"$BINARY" 2>&1)
echo "$output"
echo "$output" | grep -q "SBCL" || (echo "FAIL: Expected SBCL info not found" && exit 1)
# Skip ,info test on Windows - piped input to REPL doesn't work reliably
# The basic evaluation test using -e flag confirms the backend works
- name: Test browser server (Linux)
if: runner.os == 'Linux'
env:
BINARY: ${{ matrix.binary }}
run: |
output=$(printf ',browser test\n,quit\n' | timeout 30s ./"$BINARY" 2>&1)
echo "$output"
echo "$output" | grep -q "Browser test passed" || (echo "FAIL: Browser test did not pass" && exit 1)
- name: Test browser server (macOS)
if: runner.os == 'macOS'
env:
BINARY: ${{ matrix.binary }}
run: |
output=$(printf ',browser test\n,quit\n' | gtimeout 30s ./"$BINARY" 2>&1)
echo "$output"
echo "$output" | grep -q "Browser test passed" || (echo "FAIL: Browser test did not pass" && exit 1)
- name: Test ,dis command (Linux)
if: runner.os == 'Linux'
env:
BINARY: ${{ matrix.binary }}
run: |
output=$(printf ',dis car\n,quit\n' | timeout 30s ./"$BINARY" 2>&1)
echo "$output"
echo "$output" | grep -q "disassembly for CAR" || (echo "FAIL: ,dis car did not produce disassembly" && exit 1)
- name: Test ,dis command (macOS)
if: runner.os == 'macOS'
env:
BINARY: ${{ matrix.binary }}
run: |
output=$(printf ',dis car\n,quit\n' | gtimeout 30s ./"$BINARY" 2>&1)
echo "$output"
echo "$output" | grep -q "disassembly for CAR" || (echo "FAIL: ,dis car did not produce disassembly" && exit 1)
- name: Test ,dis with package context (Linux)
if: runner.os == 'Linux'
env:
BINARY: ${{ matrix.binary }}
run: |
output=$(printf ',cd cl\n,dis length\n,quit\n' | timeout 30s ./"$BINARY" 2>&1)
echo "$output"
echo "$output" | grep -q "disassembly for LENGTH" || (echo "FAIL: ,dis length after ,cd cl did not work" && exit 1)
- name: Test ,dis with package context (macOS)
if: runner.os == 'macOS'
env:
BINARY: ${{ matrix.binary }}
run: |
output=$(printf ',cd cl\n,dis length\n,quit\n' | gtimeout 30s ./"$BINARY" 2>&1)
echo "$output"
echo "$output" | grep -q "disassembly for LENGTH" || (echo "FAIL: ,dis length after ,cd cl did not work" && exit 1)