polish #3134
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: macos | |
on: | |
push: | |
pull_request: | |
branches: [ master ] | |
jobs: | |
build-and-test: | |
name: Build and test ${{matrix.build-type}} mode | |
runs-on: macos-13 | |
strategy: | |
matrix: | |
build-type: [Debug, Release] | |
steps: | |
- name: Clone recursively | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Setup ccache | |
uses: Chocobo1/setup-ccache-action@v1 | |
with: | |
ccache_options: max_size=500M | |
override_cache_key: mac-13-ccache-${{matrix.build-type}} | |
- name: Install LLVM and Clang | |
run: brew install llvm@16 | |
- name: Configure | |
run: | | |
CC="/usr/local/opt/llvm@16/bin/clang" \ | |
CXX="/usr/local/opt/llvm@16/bin/clang++" \ | |
CXXFLAGS="-stdlib=libc++ -fexperimental-library" \ | |
LDFLAGS="-L/usr/local/opt/llvm@16/lib/c++ -Wl,-rpath,/usr/local/opt/llvm@16/lib/c++" \ | |
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DBUILD_TESTING=ON -DTHORIN_BUILD_EXAMPLES=ON -DPython3_ROOT_DIR=$(dirname $(which python3)) -DTHORIN_LIT_TIMEOUT=300 | |
sed -n -E "s/_Python3_EXECUTABLE:INTERNAL=([a-zA-Z0-9/.]+)$/THORIN_PYTHON=\1/p" ${{github.workspace}}/build/CMakeCache.txt >> $GITHUB_ENV | |
- name: Install FileCheck | |
uses: robinraju/[email protected] | |
with: | |
repository: "fodinabor/FileCheckBuild" | |
latest: true | |
fileName: FileCheck-x86_64-mac | |
out-file-path: bin | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Install LIT | |
run: | | |
${THORIN_PYTHON} -m pip install lit psutil | |
ln -s ${{github.workspace}}/bin/FileCheck-x86_64-mac ${{github.workspace}}/bin/FileCheck | |
chmod +x ${{github.workspace}}/bin/FileCheck | |
- name: Prepare LLVM | |
run: | | |
LLVM_PATH=${{ env.LLVM_PATH }} | |
LLVM_VERSION=${{ matrix.clang }} | |
echo "SDKROOT=$(xcrun --sdk macosx --show-sdk-path)" >> $GITHUB_ENV | |
echo "CPATH=$LLVM_PATH/lib/clang/$LLVM_VERSION/include/" >> $GITHUB_ENV | |
echo "LDFLAGS=-L$LLVM_PATH/lib" >> $GITHUB_ENV | |
echo "CPPFLAGS=-I$LLVM_PATH/include" >> $GITHUB_ENV | |
echo "CC=$LLVM_PATH/bin/clang" >> $GITHUB_ENV | |
echo "CXX=$LLVM_PATH/bin/clang++" >> $GITHUB_ENV | |
- name: Build | |
run: cmake --build ${{github.workspace}}/build -v | |
- name: Run lit test suite | |
working-directory: ${{github.workspace}}/build | |
run: | | |
export PATH=${{github.workspace}}/bin:$PATH | |
cmake --build ${{github.workspace}}/build -v --target lit | |
- name: Test | |
working-directory: ${{github.workspace}}/build | |
run: | | |
export PATH=${{github.workspace}}/bin:$PATH | |
ctest --verbose -C ${{matrix.build-type}} --output-on-failure |