|
| 1 | +name: Homebrew Formula Test |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - master |
| 7 | + - homebrew-formula |
| 8 | + paths: |
| 9 | + - 'packaging/homebrew/**' |
| 10 | + - '.github/workflows/homebrew.yml' |
| 11 | + pull_request: |
| 12 | + branches: |
| 13 | + - master |
| 14 | + paths: |
| 15 | + - 'packaging/homebrew/**' |
| 16 | + - '.github/workflows/homebrew.yml' |
| 17 | + workflow_dispatch: |
| 18 | + |
| 19 | +jobs: |
| 20 | + test-formula: |
| 21 | + name: Test Homebrew Formula |
| 22 | + runs-on: macos-latest |
| 23 | + |
| 24 | + steps: |
| 25 | + - name: Checkout repository |
| 26 | + uses: actions/checkout@v4 |
| 27 | + |
| 28 | + - name: Set up Homebrew |
| 29 | + run: | |
| 30 | + echo "Homebrew version:" |
| 31 | + brew --version |
| 32 | + echo "Updating Homebrew..." |
| 33 | + brew update |
| 34 | + |
| 35 | + - name: Install formula dependencies |
| 36 | + run: | |
| 37 | + echo "Installing MFC dependencies..." |
| 38 | + brew install cmake gcc [email protected] boost fftw hdf5 open-mpi openblas |
| 39 | + |
| 40 | + - name: Validate formula syntax |
| 41 | + run: | |
| 42 | + echo "Checking formula syntax..." |
| 43 | + brew audit --strict --online packaging/homebrew/mfc.rb || true |
| 44 | + brew style packaging/homebrew/mfc.rb |
| 45 | + |
| 46 | + - name: Install MFC from formula |
| 47 | + run: | |
| 48 | + echo "Installing MFC from local formula..." |
| 49 | + brew install --build-from-source --verbose packaging/homebrew/mfc.rb |
| 50 | + |
| 51 | + - name: Run formula tests |
| 52 | + run: | |
| 53 | + echo "Running Homebrew formula tests..." |
| 54 | + brew test mfc |
| 55 | + |
| 56 | + - name: Test MFC commands |
| 57 | + run: | |
| 58 | + echo "Testing MFC wrapper..." |
| 59 | + mfc --help |
| 60 | + |
| 61 | + echo "Testing binaries..." |
| 62 | + pre_process -h |
| 63 | + simulation -h |
| 64 | + post_process -h |
| 65 | + |
| 66 | + echo "Testing case file parsing..." |
| 67 | + mfc count $(brew --prefix)/share/mfc/examples/1D_sodshocktube/case.py |
| 68 | + |
| 69 | + - name: Verify installation structure |
| 70 | + run: | |
| 71 | + echo "Checking installed files..." |
| 72 | + ls -la $(brew --prefix)/bin/mfc |
| 73 | + ls -la $(brew --prefix)/bin/pre_process |
| 74 | + ls -la $(brew --prefix)/bin/simulation |
| 75 | + ls -la $(brew --prefix)/bin/post_process |
| 76 | + ls -la $(brew --prefix)/libexec/mfc.sh |
| 77 | + ls -la $(brew --prefix)/Cellar/mfc/*/toolchain/ |
| 78 | + |
| 79 | + echo "Installation verified successfully!" |
| 80 | + |
| 81 | + - name: Uninstall and cleanup |
| 82 | + if: always() |
| 83 | + run: | |
| 84 | + echo "Cleaning up..." |
| 85 | + brew uninstall mfc || true |
| 86 | + brew cleanup |
| 87 | +
|
0 commit comments