Added some checks to confirm script #9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Herbie Binaries in Odyssey | |
on: | |
push: | |
branches: | |
- main | |
- '*' | |
workflow_dispatch: | |
jobs: | |
build-herbie: | |
name: Build Herbie Binaries | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu-20.04 | |
os-name: linux | |
arch: x64 | |
- os: macos-latest | |
os-name: macos | |
arch: x64 | |
- os: windows-latest | |
os-name: windows | |
arch: x64 | |
runs-on: ${{ matrix.os }} | |
steps: | |
# Checkout Odyssey repository | |
- name: Checkout Odyssey repository | |
uses: actions/checkout@v4 | |
# Clone Herbie repository inside Odyssey | |
- name: Clone Herbie repository | |
run: git clone https://github.com/herbie-fp/herbie.git | |
# Install Racket (Required for Herbie) | |
- name: Install Racket | |
uses: Bogdanp/[email protected] | |
with: | |
version: 8.11 | |
architecture: ${{ matrix.arch }} | |
# Install Rust Compiler (For egg-herbie) | |
- name: Install Rust compiler | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: stable | |
# Build egg-herbie (Rust Backend for Herbie) | |
- name: Build egg-herbie | |
run: | | |
cd herbie/egg-herbie | |
cargo build --release | |
- name: Build Herbie | |
run: | | |
cd herbie | |
make install | |
# Create Tarball for Distribution | |
- name: Create tarball | |
run: | | |
cd herbie | |
raco pkg create --format zip egg-herbie | |
# Rename Tarballs and Checksums | |
- name: Rename tarballs | |
run: | | |
cd herbie | |
mv egg-herbie.zip egg-herbie-${{ matrix.os-name }}.zip | |
mv egg-herbie.zip.CHECKSUM egg-herbie-${{ matrix.os-name }}.zip.CHECKSUM | |
# Upload Pre-built Tarball | |
- name: Upload pre-built egg-herbie | |
uses: actions/upload-artifact@v4 | |
with: | |
path: herbie/egg-herbie-${{ matrix.os-name }}.zip | |
name: egg-herbie-${{ matrix.os-name }}.zip | |
if-no-files-found: error | |
# Upload Pre-built Checksum | |
- name: Upload pre-built egg-herbie checksum | |
uses: actions/upload-artifact@v4 | |
with: | |
path: herbie/egg-herbie-${{ matrix.os-name }}.zip.CHECKSUM | |
name: egg-herbie-${{ matrix.os-name }}.zip.CHECKSUM | |
if-no-files-found: error | |
- name: Check if Herbie is a script or binary | |
run: file /home/runner/.local/share/racket/8.11/bin/herbie | |
- name: Test Herbie Execution | |
run: /home/runner/.local/share/racket/8.11/bin/herbie --help | |
# Upload Herbie Binary to Odyssey Artifacts | |
- name: Upload Herbie Binary to Odyssey | |
uses: actions/upload-artifact@v4 | |
with: | |
path: /home/runner/.local/share/racket/8.11/bin/herbie | |
name: herbie-binary-${{ matrix.os-name }}.tar.gz | |
if-no-files-found: error |