Skip to content

Commit

Permalink
Added GitHub actions workflow file.
Browse files Browse the repository at this point in the history
  • Loading branch information
VolkerEnderlein committed Apr 30, 2020
1 parent 281bd5a commit f90beb0
Showing 1 changed file with 100 additions and 0 deletions.
100 changes: 100 additions & 0 deletions .github/workflows/continuous-integration-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: Continuous Integration Build

on:
pull_request:
branches: [ master ]
# push:
# branches: [ master ]

jobs:
ubuntu-build:
name: Ubuntu Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Checkout submodules
run: git submodule update --init --recursive
- name: Create build directory and run CMake
run: |
sudo apt-get -y install freeglut3-dev libmotif-dev libxpm-dev libxmu-dev
mkdir cmake_download_dir
DOWNLOAD_FILE_COIN=coin-latest-Ubuntu-gcc7-x64.tar.gz
RELEASE_ID=`curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/coin3d/coin/releases | jq -r --arg COIN_REPO_TAG_NAME "CI-builds" '.[] | select(.tag_name==$COIN_REPO_TAG_NAME) | .id'`
ASSET_ID=`curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/coin3d/coin/releases/$RELEASE_ID | jq -r --arg DOWNLOAD_FILE_COIN "$DOWNLOAD_FILE_COIN" '.assets[] | select(.name==$DOWNLOAD_FILE_COIN) | .id'`
export DOWNLOAD_ADDRESS_COIN=https://api.github.com/repos/coin3d/coin/releases/assets/$ASSET_ID
echo download file $DOWNLOAD_FILE_COIN from address $DOWNLOAD_ADDRESS_COIN
curl -s -S -L -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -H "Accept: application/octet-stream" -o $DOWNLOAD_FILE_COIN $DOWNLOAD_ADDRESS_COIN
tar xzf $DOWNLOAD_FILE_COIN -C cmake_download_dir
cmake -S . -B cmake_build_dir -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=cmake_install_dir -DCMAKE_PREFIX_PATH=cmake_download_dir/Coin3D
- name: Build project
run: cmake --build cmake_build_dir --target install --config Release -- -j4
# - name: Run tests
# working-directory: cmake_build_dir
# run: ctest -C Release -VV
- name: Create Artifacts
uses: actions/upload-artifact@v1
with:
name: Ubuntu-Artifacts
path: cmake_install_dir/
if: always()

# windows-build:
# name: Windows Build
# runs-on: windows-latest
# steps:
# - uses: actions/checkout@v2
# - name: Checkout submodules
# run: git submodule update --init --recursive
# - name: Create build directory and run CMake
# shell: cmd
# run: |
# mkdir cmake_download_dir
# set DOWNLOAD_FILE_COIN=coin-latest-msvc16-x64.zip
# for /f %%i in ('curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/coin3d/coin/releases ^| jq -r --arg COIN_REPO_TAG_NAME "CI-builds" ".[] | select(.tag_name==$COIN_REPO_TAG_NAME) | .id"') do set RELEASE_ID=%%i
# for /f %%i in ('curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/coin3d/coin/releases/%RELEASE_ID% ^| jq -r --arg DOWNLOAD_FILE_COIN "%DOWNLOAD_FILE_COIN%" ".assets[] | select(.name==$DOWNLOAD_FILE_COIN) | .id"') do set ASSET_ID=%%i
# set DOWNLOAD_ADDRESS_COIN=https://api.github.com/repos/coin3d/coin/releases/assets/%ASSET_ID%
# echo download file %DOWNLOAD_FILE_COIN% from address %DOWNLOAD_ADDRESS_COIN%
# curl -s -S -L -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -H "Accept: application/octet-stream" -o %DOWNLOAD_FILE_COIN% %DOWNLOAD_ADDRESS_COIN%
# 7z x %DOWNLOAD_FILE_COIN% -ocmake_download_dir
# cmake -S . -B cmake_build_dir -G "Visual Studio 16 2019" -A x64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=cmake_install_dir -DCMAKE_PREFIX_PATH=cmake_download_dir/Coin3D
# - name: Build project
# run: cmake --build cmake_build_dir --target INSTALL --config Release -- /nologo /verbosity:minimal /maxcpucount:2 /property:MultiProcessorCompilation=true
# # - name: Run tests
# # working-directory: cmake_build_dir
# # run: ctest -C Release -VV
# - name: Create Artifacts
# uses: actions/upload-artifact@v1
# with:
# name: Windows-Artifacts
# path: cmake_install_dir/
# if: always()
#
# macos-build:
# name: MacOS Build
# runs-on: macos-latest
# steps:
# - uses: actions/checkout@v2
# - name: Checkout submodules
# run: git submodule update --init --recursive
# - name: Create build directory and run CMake
# run: |
# mkdir cmake_download_dir
# DOWNLOAD_FILE_COIN=coin-latest-macos-clang11-x64.tar.gz
# RELEASE_ID=`curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/coin3d/coin/releases | jq -r --arg COIN_REPO_TAG_NAME "CI-builds" '.[] | select(.tag_name==$COIN_REPO_TAG_NAME) | .id'`
# ASSET_ID=`curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/coin3d/coin/releases/$RELEASE_ID | jq -r --arg DOWNLOAD_FILE_COIN "$DOWNLOAD_FILE_COIN" '.assets[] | select(.name==$DOWNLOAD_FILE_COIN) | .id'`
# export DOWNLOAD_ADDRESS_COIN=https://api.github.com/repos/coin3d/coin/releases/assets/$ASSET_ID
# echo download file $DOWNLOAD_FILE_COIN from address $DOWNLOAD_ADDRESS_COIN
# curl -s -S -L -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -H "Accept: application/octet-stream" -o $DOWNLOAD_FILE_COIN $DOWNLOAD_ADDRESS_COIN
# tar xzf $DOWNLOAD_FILE_COIN -C cmake_download_dir
# cmake -S . -B cmake_build_dir -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=cmake_install_dir -DCMAKE_PREFIX_PATH="cmake_download_dir/Coin3D"
# - name: Build project
# run: cmake --build cmake_build_dir --target install --config Release -- -j4
# # - name: Run tests
# # working-directory: cmake_build_dir
# # run: ctest -C Release -VV
# - name: Create Artifacts
# uses: actions/upload-artifact@v1
# with:
# name: MacOS-Artifacts
# path: cmake_install_dir/
# if: always()

0 comments on commit f90beb0

Please sign in to comment.