ci: Add platform-dependent artifact setup #849
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: | | |
./configure.sh ${{ matrix.build-type }} | |
cd build | |
make -j2 | |
- name: Test | |
run: ctest --output-on-failure | |
working-directory: build | |
- name: Upload artifact | |
if: | | |
github.event_name == 'push' && | |
github.ref == 'refs/heads/main' && | |
matrix.build-type == 'release' | |
uses: ./.github/actions/upload-artifact | |
with: | |
binary-dir: build/src | |
shell: ${{ matrix.shell }} |