Skip to content

improve: logging to file can now be conditional #408

improve: logging to file can now be conditional

improve: logging to file can now be conditional #408

Workflow file for this run

name: ubuntu
on: [push]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ !(startsWith(github.ref, 'release/') || github.ref == 'develop')}}
jobs:
# verify the project's formatting, errors out if a difference is detected and generates a patch
# the user should apply to fix it.
formatting:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v1
with:
submodules: recursive
- name: verify c++ formatting
run: python3 tools/clang-format.py --verify
- name: verify python formatting
uses: psf/black@stable
with:
options: "--check --diff --color"
src: "./tools"
# build the project for the various permutations
build:
strategy:
fail-fast: false
matrix:
target: [gnu-linux, android]
compiler: [gcc, clang]
graphics: [vulkan, all]
include:
- target: gnu-linux
name: gnulinux
arch: x86_64
- target: android
name: android
arch: arm64
- cc: gcc-12
cxx: g++-12
benchmarks: OFF
tests: ON
compiler: gcc
target: gnu-linux
- cc: gcc-12
cxx: g++-12
benchmarks: OFF
tests: OFF
compiler: gcc
target: android
- cc: clang-16
cxx: clang++-16
benchmarks: OFF
tests: OFF
compiler: clang
- compiler: gcc
graphics: all
benchmarks: ON
exclude:
- target: android
compiler: clang
- target: android
graphics: all
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
name: build
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v1
with:
submodules: recursive
- uses: SimenB/github-actions-cpu-cores@v1
id: cpu-cores
- name: setup dependencies
run: python3 tools/generate_project_info.py
- name: setup clang
if: ${{ matrix.compiler == 'clang' }}
run: |
wget https://apt.llvm.org/llvm.sh
chmod u+x llvm.sh
sudo ./llvm.sh 16
- name: install GL libraries
if: ${{ matrix.graphics == 'all' || matrix.graphics == 'gles' }}
run: |
sudo apt-get update
sudo apt-get install libgl1-mesa-dev libegl1-mesa-dev -y
- name: dependencies
if: ${{ matrix.target == 'android' }}
run: yes | ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager --licenses
- name: initialize
run: cmake --preset=${{ matrix.target }}-release-${{ matrix.graphics }} -DPE_BENCHMARKS=${{ matrix.benchmarks }} -DPE_TESTS=${{ matrix.tests }}
- name: compile
run: cmake --build --preset=${{ matrix.target }}-release-${{ matrix.graphics }} -j ${{ steps.cpu-cores.outputs.count }}
- name: test
if: ${{ matrix.tests == 'ON' }}
run: ./builds/${{ matrix.name }}/${{ matrix.arch }}/default/bin/tests --formatter compact --no-source
- name: finalize
if: ${{ matrix.benchmarks == 'ON' }}
uses: actions/upload-artifact@v3
with:
name: ubuntu-${{ matrix.compiler }}-${{ matrix.graphics }}-bin
path: builds/${{ matrix.name }}/${{ matrix.arch }}/default/bin/benchmarks
if-no-files-found: error
retention-days: 1
- name: verify
if: ${{ matrix.target == 'android' }}
run: python3 -c "import os;import sys;sys.exit(0) if os.path.exists('builds/${{ matrix.name }}/${{ matrix.arch }}/main/build/outputs/bundle/release/main-release.aab') else sys.exit(1)"
# run benchmarks for the permutations that build the benchmarks binary
benchmark:
strategy:
fail-fast: false
matrix:
graphics: [ all ]
compiler: [ gcc ]
name: benchmark
needs: build
runs-on: ubuntu-22.04
steps:
- name: setup
id: download
uses: actions/download-artifact@v3
with:
name: ubuntu-${{ matrix.compiler }}-${{ matrix.graphics }}-bin
- name: install GL libraries
if: ${{ matrix.graphics == 'all' || matrix.graphics == 'gles' }}
run: |
sudo apt-get update
sudo apt-get install libgl1-mesa-dev libegl1-mesa-dev -y
- name: prepare
run: chmod +x benchmarks
- name: benchmark
run: ./benchmarks --benchmark_out_format=json --benchmark_out=results.json
- name: finalize
uses: actions/upload-artifact@v3
with:
name: ubuntu-${{ matrix.COMPILER }}-${{ matrix.graphics }}
path: results.json
if-no-files-found: error
# fires off the documentation generator
documentation:
needs: [build, formatting]
runs-on: ubuntu-22.04
steps:
- uses: actions/github-script@v6
with:
github-token: ${{ secrets.PUSH_TOKEN }}
script: |
await github.rest.actions.createWorkflowDispatch({
owner: 'ParadigmEngine',
repo: 'ParadigmEngine.github.io',
workflow_id: 'documentation.yml',
ref: 'main'
})