ci: Rebuild self with xcodebuild #184
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: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
env: | |
BUILD_DEPS: cmake libconfig++-dev libxxhash-dev libjemalloc-dev libtsl-hopscotch-map-dev pkg-config python3-jinja2 | |
TEST_DEPS: bc bats clang node-d3 graphviz moreutils fakeroot | |
jobs: | |
build-on-macos: | |
runs-on: macos-12 | |
timeout-minutes: 30 | |
steps: | |
- name: check if SIP is enabled on this runner | |
run: | | |
csrutil status | grep "System Integrity Protection status: disabled" | |
- uses: actions/checkout@v3 | |
- uses: hendrikmuhs/ccache-action@v1 | |
with: | |
key: build-on-macos-12 | |
- name: install-deps | |
run: | | |
brew update | |
export HOMEBREW_NO_AUTO_UPDATE=1 | |
# brew often fails due to existing files, hence the --overwrite parameter and the retry | |
brew bundle -f || (for v in 3.11 3.12; do brew link --overwrite python@${v} ; done; brew bundle -f) | |
- name: configure vm | |
run: | | |
# library validation would prevent loading libfirebuild to some binaries | |
sudo defaults write /Library/Preferences/com.apple.security.libraryvalidation.plist DisableLibraryValidation -bool true | |
- name: build-out-of-tree | |
run: | | |
export PATH=$(ls -d /usr/local/Cellar/jinja2-cli/*/libexec/bin):$PATH | |
cmake -DCMAKE_CXX_FLAGS="-I/usr/local/include" -DCMAKE_EXE_LINKER_FLAGS="-L/usr/local/lib" -DCMAKE_BUILD_TYPE=Debug -B build-make | |
export XML_CATALOG_FILES=/usr/local/etc/xml/catalog | |
make -C build-make -j2 | |
- name: test | |
run: | | |
export XML_CATALOG_FILES=/usr/local/etc/xml/catalog | |
make -C build-make check | |
- name: rebuild-self-with-xcode | |
run: | | |
export PATH=$(ls -d /usr/local/Cellar/jinja2-cli/*/libexec/bin):$PATH | |
export PYTHONPATH=$(ls -d /usr/local/Cellar/jinja2-cli/*/libexec/lib/python*/site-packages | tail -n1) | |
ls -R /usr/local/Cellar/jinja2-cli/ | |
cd build-make/test | |
cmake -G Xcode -DCMAKE_CXX_FLAGS="-I/usr/local/include" -DCMAKE_EXE_LINKER_FLAGS="-L/usr/local/lib" -S ../.. -B ../../build-xcode | |
bash -c "cd ../../build-xcode && xcodebuild" | |