test action to compile #3
This file contains hidden or 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 MARS | |
| on: | |
| push: | |
| branches: | |
| - master | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, macos-14] # macos-14 is for M3/ARM | |
| include: | |
| - os: ubuntu-latest | |
| name: Linux | |
| - os: macos-latest | |
| name: macOS Intel | |
| - os: macos-14 | |
| name: macOS ARM | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Dependencies (Linux) | |
| if: matrix.os == 'ubuntu-latest' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y build-essential cmake | |
| ./pre-install.sh | |
| - name: Install Dependencies (macOS) | |
| if: startsWith(matrix.os, 'macos') | |
| run: | | |
| brew install cmake libomp | |
| ./pre-install.sh | |
| - name: Build | |
| run: | | |
| make -f Makefile | |
| - name: Test Binary | |
| run: | | |
| ./mars -h | grep "Usage: mars <options>" | |
| - name: Upload Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: mars-${{ matrix.name }} | |
| path: mars | |
| retention-days: 7 |