updated readme #351
Workflow file for this run
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: ubuntu | |
on: [push] | |
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: run formatter | |
run: python3 tools/clang-format.py | |
- name: verify | |
run: | | |
output=$(git diff --stat HEAD) | |
if [[ -n $output ]]; then | |
echo "changes detected, please apply the following patch" | |
git diff --patch-with-stat --color-words HEAD | |
exit 1 | |
else | |
echo "success" | |
exit 0 | |
fi | |
# build the project for the various permutations | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
target: [gnu-linux, android] | |
compiler: [gcc, clang] | |
graphics: [vulkan, all] | |
include: | |
- 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-14 | |
cxx: clang++-14 | |
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: 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/tools/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/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/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/android/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' | |
}) |