try long string #13
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: Build and test | |
on: | |
push: | |
workflow_dispatch: | |
jobs: | |
build-ubuntu: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Ninja | |
uses: seanmiddleditch/gha-setup-ninja@v5 | |
- name: Configure and Build Project | |
uses: threeal/cmake-action@main | |
with: | |
generator: Ninja | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ runner.os }}-build | |
path: | | |
build/cmaple | |
build/cmaple-aa | |
- name: Simple test | |
run: | | |
for exe in "./build/cmaple" "./build/cmaple-aa"; do | |
file $exe | |
$exe | |
$exe --help | |
done | |
build-macos-12: | |
#runs-on: [ubuntu-20.04, macos-12, macos-14, windows-2019] | |
runs-on: macos-12 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Construct flags | |
id: libomp-prefix | |
run: | | |
PREFIX=$(brew --prefix libomp) | |
CMAKE_C_FLAGS="-Xpreprocessor -fopenmp -I${PREFIX}/include -L${PREFIX}/lib -lomp" | |
CMAKE_CXX_FLAGS="-Xpreprocessor -fopenmp -I${PREFIX}/include -L${PREFIX}/lib -lomp" | |
for var in PREFIX CMAKE_C_FLAGS CMAKE_CXX_FLAGS; do | |
echo $var=${!var} | |
echo $var=${!var} >> "$GITHUB_OUTPUT" | |
done | |
- name: Setup Ninja | |
uses: seanmiddleditch/gha-setup-ninja@v5 | |
- name: Configure and Build Project | |
uses: threeal/cmake-action@main | |
with: | |
generator: Ninja | |
c-compiler: clang | |
cxx-compiler: clang++ | |
c-flags: ${{ steps.libomp-prefix.outputs.CMAKE_C_FLAGS }} | |
cxx-flags: ${{ steps.libomp-prefix.outputs.CMAKE_CXX_FLAGS }} | |
options: CMAPLE_FLAGS=static | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ runner.os }}-build | |
path: | | |
build/cmaple | |
build/cmaple-aa | |
- name: Simple test | |
run: | | |
for exe in "./build/cmaple" "./build/cmaple-aa"; do | |
file $exe | |
$exe | |
$exe --help | |
done | |
build-macos-14: | |
runs-on: macos-14 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Construct flags | |
id: libomp-prefix | |
run: | | |
PREFIX=$(brew --prefix libomp) | |
CMAKE_C_FLAGS="-Xpreprocessor -fopenmp -I${PREFIX}/include -L${PREFIX}/lib -lomp" | |
CMAKE_CXX_FLAGS="-Xpreprocessor -fopenmp -I${PREFIX}/include -L${PREFIX}/lib -lomp" | |
for var in PREFIX CMAKE_C_FLAGS CMAKE_CXX_FLAGS; do | |
echo $var=${!var} | |
echo $var=${!var} >> "$GITHUB_OUTPUT" | |
done | |
- name: Setup Ninja | |
uses: seanmiddleditch/gha-setup-ninja@v5 | |
- name: Configure and Build Project | |
uses: threeal/cmake-action@main | |
with: | |
generator: Ninja | |
c-compiler: clang | |
cxx-compiler: clang++ | |
c-flags: ${{ steps.libomp-prefix.outputs.CMAKE_C_FLAGS }} | |
cxx-flags: ${{ steps.libomp-prefix.outputs.CMAKE_CXX_FLAGS }} | |
options: | | |
CMAPLE_FLAGS=static | |
CMAKE_EXE_LINKER_FLAGS='-lomp' | |
CMAKE_STATIC_LINKER_FLAGS='-lomp' | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ runner.os }}-build | |
path: | | |
build/cmaple | |
build/cmaple-aa | |
- name: Simple test | |
run: | | |
for exe in "./build/cmaple" "./build/cmaple-aa"; do | |
file $exe | |
$exe | |
$exe --help | |
done | |
build-windows: | |
runs-on: windows-2019 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Ninja | |
uses: seanmiddleditch/gha-setup-ninja@v5 | |
- name: Configure and Build Project | |
uses: threeal/cmake-action@main | |
with: | |
generator: Ninja | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ runner.os }}-build | |
path: | | |
build\cmaple | |
build\cmaple-aa | |
- name: Simple test | |
run: |- | |
build\cmaple | |
build\cmaple --help |