Skip to content

CI build static linux arm64 #164

CI build static linux arm64

CI build static linux arm64 #164

Workflow file for this run

name: build
on:
push:
branches:
- main
- develop
pull_request:
env:
version_in_development: v1.2.0
jobs:
# draft-release:
# permissions:
# contents: write
# 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
# permissions:
# contents: write
# 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 -E test_docker
#
# build-macos-intel:
# name: build-macos-intel
# runs-on: macos-13
# permissions:
# contents: write
# 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 -E test_docker
build-linux:
strategy:
matrix:
os: [ubuntu-22.04, ubuntu-22.04-arm]
runs-on: ${{ matrix.os }}
name: build-linux-${{ matrix.os }}
permissions:
contents: write
#container:
# image: tipibuild/tipi-ubuntu:latest
# volumes:
# - /var/run/docker.sock:/var/run/docker.sock
# # --init makes sure the container has an init process running as as the PID 1 in the container. Specifying an init process ensures the usual responsibilities of an init system, such as reaping zombie processes, are performed inside the created container.
# options: --init
#needs: draft-release
steps:
- uses: actions/checkout@v2
- name: setup
run: |
sudo apt update
sudo apt-get install -y libc++-dev libc++abi-dev
# the buildx plugin is available under either one of these names
#set +e
#sudo apt-get install -y docker-buildx
#sudo apt-get install -y docker-buildx-plugin
#set -e
sudo docker --version
sudo docker buildx version
find /usr/lib -name libc++*
- name: install and build
run: |
cmake -S . -B build/linux -GNinja -DCMAKE_TOOLCHAIN_FILE=environments/linux-system-clang-cxx17-static.cmake -DCMAKE_BUILD_TYPE=Release
cmake --build build/linux
cd build/linux/
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 -E test_docker
- name: Run docker tests
run: |
# we will use this to be able to map the docker-in-docker paths between
# this environment and the containers the tests will run
export SHARE_VOLUME_FOLDER=_dind_shared_volume
export GOLDILOCK_TEST_DIND_SHARED_VOLUME_CONTAINER=${{ github.workspace }}/$SHARE_VOLUME_FOLDER
export GOLDILOCK_TEST_DIND_SHARED_VOLUME_HOST=${{ github.workspace }}/$SHARE_VOLUME_FOLDER
export GOLDILOCK_TEST_DIND_SHARED_VOLUME_TEST=$(pwd)/$SHARE_VOLUME_FOLDER
# create the folder from the test environmnent's perspective:
mkdir -p $GOLDILOCK_TEST_DIND_SHARED_VOLUME_TEST
echo "hello" > $GOLDILOCK_TEST_DIND_SHARED_VOLUME_TEST/test_from_ci_yaml
cd build/linux/
# ... we need priviledge to write to the docker socket
sudo --preserve-env ctest --verbose -R test_docker