Another #839
Workflow file for this run
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: CI | |
on: [push, pull_request] | |
jobs: | |
build: | |
strategy: | |
matrix: | |
name: [linux-x86_64, macOS-x86_64, macOS-arm64, windows-x86_64] | |
build-type: [ Release, Debug ] | |
include: | |
- name: linux-x86_64 | |
os: ubuntu-20.04 | |
shell: bash | |
- name: macOS-x86_64 | |
os: macos-13 | |
shell: bash | |
- name: macOS-arm64 | |
os: macos-14 | |
shell: bash | |
- name: windows-x86_64 | |
os: windows-latest | |
shell: 'msys2 {0}' | |
defaults: | |
run: | |
shell: ${{ matrix.shell }} | |
name: ${{ matrix.name }}:${{ matrix.build-type }} | |
# The type of runner that the job will run on | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set MACOSX_DEPLOYMENT_TARGET | |
if: runner.os == 'macOS' | |
run: echo "MACOSX_DEPLOYMENT_TARGET=11.0" >> $GITHUB_ENV | |
- name: Install Packages (Linux) | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y \ | |
libgmp-dev | |
- name: Install Packages (macOS) | |
if: runner.os == 'macOS' | |
run: | | |
brew install \ | |
gmp | |
- name: Install Packages (Windows) | |
uses: msys2/setup-msys2@v2 | |
if: runner.os == 'Windows' | |
with: | |
msystem: mingw64 | |
path-type: inherit | |
install: | | |
make | |
mingw-w64-x86_64-cmake | |
mingw-w64-x86_64-gcc | |
mingw-w64-x86_64-gmp | |
- name: Build | |
run: | | |
mkdir build | |
cd build | |
if [[ "$RUNNER_OS" == "Windows" ]]; then | |
export CMAKE_GENERATOR="MSYS Makefiles" | |
fi | |
cmake -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} .. | |
make -j2 | |
- name: Test | |
run: ctest --output-on-failure | |
working-directory: build | |
- name: Upload binary | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && matrix.build-type == 'production' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ethos-${{ matrix.name }} | |
path: build/src/ethos |