Skip to content

Homebrew formula

Homebrew formula #25

Workflow file for this run

name: Homebrew Formula Test
on:
push:
branches:
- master
- homebrew-formula
paths:
- 'packaging/homebrew/**'
- '.github/workflows/homebrew.yml'
pull_request:
branches:
- master
paths:
- 'packaging/homebrew/**'
- '.github/workflows/homebrew.yml'
workflow_dispatch:
jobs:
test-formula:
name: Test Homebrew Formula
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Homebrew
run: |
echo "Homebrew version:"
brew --version
echo "Updating Homebrew..."
brew update
- name: Install formula dependencies
run: |
echo "Installing MFC dependencies..."
brew install cmake gcc [email protected] boost fftw hdf5 open-mpi openblas sundials yaml-cpp
- name: Validate formula syntax
run: |
echo "Checking formula syntax..."
brew style packaging/homebrew/mfc.rb
- name: Install MFC from formula
run: |
echo "Creating temporary local tap..."
brew tap-new mflowcode/test
echo "Copying formula to tap..."
cp packaging/homebrew/mfc.rb $(brew --repository)/Library/Taps/mflowcode/homebrew-test/Formula/mfc.rb
echo "Installing MFC from local tap..."
brew install --build-from-source --verbose mflowcode/test/mfc
- name: Run formula tests
run: |
echo "Running Homebrew formula tests..."
brew test mfc
- name: Test MFC binaries
run: |
echo "Verifying binaries are in PATH and executable..."
which mfc
which pre_process
which simulation
which post_process
test -x $(which mfc)
test -x $(which pre_process)
test -x $(which simulation)
test -x $(which post_process)
echo "All binaries are accessible and executable!"
- name: Test MFC wrapper functionality
run: |
echo "Testing mfc command..."
mfc --help
echo "Counting example cases..."
mfc count $(brew --prefix)/share/mfc/examples/1D_sodshocktube/case.py
- name: Run MFC test case
run: |
echo "Running a simple test case (1D Sod shock tube)..."
cd $(mktemp -d)
cp $(brew --prefix)/share/mfc/examples/1D_sodshocktube/case.py .
echo "Running with $(sysctl -n hw.ncpu) processors..."
mfc run case.py -j $(sysctl -n hw.ncpu)
echo "Test case completed successfully!"
- name: Verify installation structure
run: |
echo "Checking installed files..."
ls -la $(brew --prefix)/bin/mfc
ls -la $(brew --prefix)/bin/pre_process
ls -la $(brew --prefix)/bin/simulation
ls -la $(brew --prefix)/bin/post_process
ls -la $(brew --prefix)/libexec/mfc.sh
ls -la $(brew --prefix)/share/mfc/examples/
echo "Checking Python venv..."
ls -la $(brew --prefix)/Cellar/mfc/*/libexec/venv/
$(brew --prefix)/Cellar/mfc/*/libexec/venv/bin/python --version
$(brew --prefix)/Cellar/mfc/*/libexec/venv/bin/pip list | grep -E "(cantera|mfc)"
echo "Installation verified successfully!"
- name: Uninstall and cleanup
if: always()
run: |
echo "Cleaning up..."
brew uninstall mfc || true
brew cleanup