Skip to content

Build-Test-Upload

Build-Test-Upload #323

Workflow file for this run

name: Build-Test-Upload
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
schedule:
- cron: 0 6 * * 1 # Each Monday at 06:00 UTC
defaults:
run:
shell: bash
jobs:
build:
runs-on: ${{ matrix.os || 'ubuntu-latest' }}
strategy:
fail-fast: false
matrix:
include:
- name: cmake:clang-10
mode: cmake
env: CC=/usr/bin/clang-10 CXX=/usr/bin/clang++-10
os: ubuntu-20.04
- name: cmake:clang-11
mode: cmake
env: CC=/usr/bin/clang-11 CXX=/usr/bin/clang++-11
os: ubuntu-20.04
- name: cmake:clang-12
mode: cmake
env: CC=/usr/bin/clang-12 CXX=/usr/bin/clang++-12
- name: cmake:clang-13
mode: cmake
env: CC=/usr/bin/clang-13 CXX=/usr/bin/clang++-13
- name: cmake:clang-14
mode: cmake
env: CC=/usr/bin/clang-14 CXX=/usr/bin/clang++-14
- name: cmake:gcc-9
mode: cmake
env: CC=/usr/bin/gcc-9 CXX=/usr/bin/g++-9
- name: cmake:gcc-10
mode: cmake
env: CC=/usr/bin/gcc-10 CXX=/usr/bin/g++-10
- name: cmake:gcc-11
mode: cmake
env: CC=/usr/bin/gcc-11 CXX=/usr/bin/g++-11
- name: cmake:gcc-12
mode: cmake
env: CC=/usr/bin/gcc-12 CXX=/usr/bin/g++-12
- name: cmake:android:arm64-v8a
mode: cmake
cmake_params: -DCMAKE_TOOLCHAIN_FILE="$ANDROID_NDK/build/cmake/android.toolchain.cmake" -DANDROID_ABI=arm64-v8a -DANDROID_NATIVE_API_LEVEL=25 -DBUILD_TESTING=off
- name: cmake:wasm
mode: cmake
wasm: true
cmake_params: -DCMAKE_TOOLCHAIN_FILE="$EMSDK/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake" -DBUILD_TESTING=off
env: source ~/emsdk/emsdk_env.sh &&
- name: cmake:win:default
mode: cmake
upload_artifacts: true
os: windows-latest
- name: cmake:osx:default
mode: cmake
os: macos-latest
- name: bazel:c
mode: bazel
bazel_project_root: .
- name: bazel:java
mode: bazel
bazel_project_root: java
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive
- name: Cache EMSDK
if: ${{ matrix.wasm }}
id: cache-emsdk
uses: actions/cache@v1
with:
path: ~/emsdk
key: ${{ runner.os }}-emsdk
- name: Install EMSDK
if: ${{ matrix.wasm && steps.cache-emsdk.outputs.cache-hit != 'true' }}
run: |
cd ~/
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
git pull
./emsdk install latest
- name: Post-install EMSDK
if: ${{ matrix.wasm }}
run: |
cd ~/emsdk
./emsdk activate latest
- name: Configure @ CMake
if: ${{ matrix.mode == 'cmake' }}
run: ${{ matrix.env }} cmake -DCMAKE_BUILD_TYPE=Release ${{ matrix.cmake_params }} -B out
- name: Build @ CMake
if: ${{ matrix.mode == 'cmake' }}
run: cmake --build out --config Release -j 2
- name: Test @ CMake
if: ${{ matrix.mode == 'cmake' }}
run: cd out && ctest -j 2
- name: Build @ Bazel
if: ${{ matrix.mode == 'bazel' }}
run: cd ${{ matrix.bazel_project_root }} && bazelisk build -c opt ...:all
- name: Test @ Bazel
if: ${{ matrix.mode == 'bazel' }}
run: cd ${{ matrix.bazel_project_root }} && bazelisk test -c opt ...:all
- name: upload
if: ${{ matrix.upload_artifacts }}
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.os }}
path: out/artifacts