Fix macOS test #57
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: | |
branches: | |
- main | |
- develop | |
pull_request: | |
env: | |
version_in_development: v1.1.0 | |
jobs: | |
draft-release: | |
name: Draft Release if develop branch | |
runs-on: ubuntu-latest | |
outputs: | |
upload_url: ${{ steps.draft_release.outputs.upload_url }} | |
release_id: ${{ steps.draft_release.outputs.id }} | |
steps: | |
- name: Create Release | |
id: draft_release | |
if: github.head_ref == 'develop' | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
owner: tipi-build | |
repo: goldilock | |
commitish: ${{ github.sha }} | |
tag_name: ${{ env.version_in_development }} | |
release_name: ${{ env.version_in_development }} ${{ github.sha }} | |
draft: true | |
prerelease: true | |
build-macos: | |
name: build-macos | |
runs-on: macos-latest | |
needs: draft-release | |
steps: | |
- uses: actions/checkout@v2 | |
- name: install and build | |
run: | | |
cmake -S . -B build/macos -DCMAKE_TOOLCHAIN_FILE=environments/macos-clang-cxx17.cmake -DCMAKE_BUILD_TYPE=Release | |
cmake --build build/macos | |
cd build/macos/ && cpack -G ZIP | |
- name: Upload goldilock package | |
if: ${{needs.draft-release.outputs.upload_url}} | |
id: upload-tipi-goldilock-package | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{needs.draft-release.outputs.upload_url}} | |
asset_path: ./build/macos/goldilock.zip | |
asset_name: goldilock-macos.zip | |
asset_content_type: application/zip | |
- name: Run tests | |
run: | | |
cd build/macos/ | |
ctest --verbose | |
build-macos-intel: | |
name: build-macos-intel | |
runs-on: macos-13 | |
needs: draft-release | |
steps: | |
- uses: actions/checkout@v2 | |
- name: install and build | |
run: | | |
cmake -S . -B build/macos -DCMAKE_TOOLCHAIN_FILE=environments/macos-clang-cxx17.cmake -DCMAKE_BUILD_TYPE=Release | |
cmake --build build/macos | |
cd build/macos/ | |
cpack -G ZIP | |
- name: Upload goldilock package | |
if: ${{needs.draft-release.outputs.upload_url}} | |
id: upload-tipi-goldilock-package | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{needs.draft-release.outputs.upload_url}} | |
asset_path: ./build/macos/goldilock.zip | |
asset_name: goldilock-macos-intel.zip | |
asset_content_type: application/zip | |
- name: Run tests | |
run: | | |
cd build/macos/ | |
ctest --verbose | |
build-linux: | |
name: build-linux | |
runs-on: ubuntu-latest | |
container: | |
image: tipibuild/tipi-ubuntu:latest | |
needs: draft-release | |
steps: | |
- uses: actions/checkout@v2 | |
- name: install and build | |
run: | | |
tipi run cmake -S . -B build/linux -DCMAKE_TOOLCHAIN_FILE=environments/linux-clang-cxx17-static.cmake -DCMAKE_BUILD_TYPE=Release | |
tipi run cmake --build build/linux | |
cd build/linux/ | |
tipi run cpack -G ZIP | |
- name: Upload goldilock package | |
if: ${{needs.draft-release.outputs.upload_url}} | |
id: upload-tipi-goldilock-package | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{needs.draft-release.outputs.upload_url}} | |
asset_path: ./build/linux/goldilock.zip | |
asset_name: goldilock-linux.zip | |
asset_content_type: application/zip | |
- name: Run tests | |
run: | | |
cd build/linux/ | |
tipi run ctest --verbose |