Update unused dependency #27
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: Build | |
on: [push, pull_request] | |
jobs: | |
build: | |
name: TREW ${{ matrix.OS_NAME }} build | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: windows-latest | |
OS_NAME: "Windows" | |
BINARY_LOCATION: ./build/trew.exe | |
TEST_BINARY_BASENAME: trew_test.exe | |
BINARY_OUTPUT_POSTFIX: windows-x86_64 | |
- os: ubuntu-20.04 | |
OS_NAME: "Linux" | |
BINARY_LOCATION: ./build/trew | |
TEST_BINARY_BASENAME: trew_test | |
BINARY_OUTPUT_POSTFIX: linux-x86_64 | |
- os: macos-latest | |
OS_NAME: "MacOS" | |
BINARY_LOCATION: ./build/trew | |
TEST_BINARY_BASENAME: trew_test | |
BINARY_OUTPUT_POSTFIX: macos-universal | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Cache C++ dependency | |
id: vcpkg-cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
./vcpkg | |
./vcpkg_installed | |
key: ${{ matrix.os }}-vcpkg-cache-${{ hashFiles('vcpkg.json') }} | |
- name: Install C++ dependency | |
if: steps.vcpkg-cache.outputs.cache-hit != 'true' | |
run: | | |
git clone https://github.com/Microsoft/vcpkg.git | |
if [[ ${{ matrix.OS_NAME }} == 'Windows' ]]; then | |
./vcpkg/bootstrap-vcpkg.bat | |
./vcpkg/vcpkg install | |
fi | |
if [[ ${{ matrix.OS_NAME }} == 'Linux' ]]; then | |
./vcpkg/bootstrap-vcpkg.sh | |
./vcpkg/vcpkg install | |
fi | |
if [[ ${{ matrix.OS_NAME }} == 'MacOS' ]]; then | |
python3 .github/workflows/vcpkg_manifest_to_classic.py vcpkg.json > vcpkg.txt | |
rm -f vcpkg.json | |
git clone https://github.com/faaxm/lipo-dir-merge.git | |
./vcpkg/bootstrap-vcpkg.sh | |
./vcpkg/vcpkg install --triplet=x64-osx @vcpkg.txt | |
./vcpkg/vcpkg install --triplet=arm64-osx @vcpkg.txt | |
python3 ./lipo-dir-merge/lipo-dir-merge.py ./vcpkg/installed/arm64-osx ./vcpkg/installed/x64-osx ./vcpkg/installed/uni-osx | |
fi | |
shell: bash | |
- name: Build TREW | |
run: | | |
mkdir build | |
mkdir trew-${{ matrix.BINARY_OUTPUT_POSTFIX }} | |
cp LICENSE trew-${{ matrix.BINARY_OUTPUT_POSTFIX }}/ | |
if [[ ${{ matrix.OS_NAME }} == 'Windows' ]]; then | |
cmake -B build -S . -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake | |
cmake --build build --config Release | |
cp build/Release/* trew-${{ matrix.BINARY_OUTPUT_POSTFIX }}/ | |
fi | |
if [[ ${{ matrix.OS_NAME }} == 'Linux' ]]; then | |
cmake -B build -S . -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake | |
cmake --build build | |
cp build/trew* trew-${{ matrix.BINARY_OUTPUT_POSTFIX }}/ | |
fi | |
if [[ ${{ matrix.OS_NAME }} == 'MacOS' ]]; then | |
rm -f vcpkg.json | |
cmake -B build -S . -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=./vcpkg/installed/uni-osx -DVCPKG_TARGET_TRIPLET=uni-osx -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" | |
cmake --build build | |
cp build/trew* trew-${{ matrix.BINARY_OUTPUT_POSTFIX }}/ | |
fi | |
if [[ ${{ startsWith(github.ref, 'refs/tags/') }} == 'true' ]]; then | |
tar --exclude="${{ matrix.TEST_BINARY_BASENAME }}" -zcvf trew-${{ matrix.BINARY_OUTPUT_POSTFIX }}.tar.gz trew-${{ matrix.BINARY_OUTPUT_POSTFIX }} | |
fi | |
shell: bash | |
- name: Test TREW | |
working-directory: ./trew-${{ matrix.BINARY_OUTPUT_POSTFIX }} | |
run: | | |
./${{ matrix.TEST_BINARY_BASENAME }} | |
rm ${{ matrix.TEST_BINARY_BASENAME }} | |
shell: bash | |
- name: Upload TREW to Github artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: trew-${{ matrix.BINARY_OUTPUT_POSTFIX }} | |
path: ./trew-${{ matrix.BINARY_OUTPUT_POSTFIX }} | |
- name: Upload TREW to release | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: trew-${{ matrix.BINARY_OUTPUT_POSTFIX }}.tar.gz | |
tag: ${{ github.ref }} |