Skip to content

regenerate cli to nimlang and add nix build #61

regenerate cli to nimlang and add nix build

regenerate cli to nimlang and add nix build #61

Workflow file for this run

name: Build and Test Godon CLI
on:
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Cleanup previous build artifacts
run: |
echo "Cleaning up any previous build artifacts..."
rm -rf result || true
- name: Install Nix
uses: cachix/install-nix-action@v25
with:
nix_path: nixpkgs=channel:nixos-25.11
extra_nix_config: |
sandbox = false
sandbox-paths = /etc/ssl/certs/ca-bundle.crt
experimental-features = nix-command flakes
- name: Configure Nix daemon SSL certificates
run: |
# Find and symlink SSL certificates for Nix daemon
sudo mkdir -p /etc/ssl/certs
CERT_BUNDLE=$(find /nix/store -name "ca-bundle.crt" | head -1)
echo "Found certificate bundle: $CERT_BUNDLE"
sudo ln -sf "$CERT_BUNDLE" /etc/ssl/certs/ca-bundle.crt
sudo ln -sf "$CERT_BUNDLE" /etc/ssl/certs/ca-certificates.crt
# Set environment variables for this session
export SSL_CERT_FILE="/etc/ssl/certs/ca-bundle.crt"
export NIX_SSL_CERT_FILE="/etc/ssl/certs/ca-bundle.crt"
export CURL_CA_BUNDLE="/etc/ssl/certs/ca-bundle.crt"
# Add to nix.conf for daemon
echo "ssl-cert-file = /etc/ssl/certs/ca-bundle.crt" | sudo tee -a /etc/nix/nix.conf
echo "SSL certificates configured for Nix daemon"
- name: Build with Nix
run: |
export SSL_CERT_FILE="/etc/ssl/certs/ca-bundle.crt"
export NIX_SSL_CERT_FILE="/etc/ssl/certs/ca-bundle.crt"
export CURL_CA_BUNDLE="/etc/ssl/certs/ca-bundle.crt"
nix --experimental-features "nix-command flakes" build --verbose
- name: Test binary
run: |
echo "Checking build output..."
echo "Result path:"
nix path-info .#default
echo "Contents of result directory:"
ls -la $(nix path-info .#default)/ || echo "result directory contents"
echo "Checking $out/bin directory:"
ls -la $(nix path-info .#default)/bin/ || echo "$out/bin not found"
echo "Testing compiled binary with direct path..."
$(nix path-info .#default)/bin/godon-cli --help
- name: Test breeder commands
run: |
# Test basic CLI functionality
nix run .#default -- --help
nix run .#default -- breeder --help || true # May fail, but tests argument parsing