Github Actions CI #346
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: Github Actions CI | |
on: | |
push: | |
paths-ignore: | |
- '**/README.md' | |
- 'docs/**/*' | |
schedule: | |
- cron: '0 6 * * *,*' | |
jobs: | |
check-format: | |
runs-on: "ubuntu-20.04" | |
name: "Check formatting" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- name: Install dependencies | |
run: | | |
pip install pre-commit | |
- name: Check formatting | |
run: | | |
pre-commit run --all-files | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ "windows-2019", "ubuntu-20.04"] | |
use_unity_build: ${{ github.event_name == 'schedule' && fromJSON('["True", "False"]') || fromJSON('["True"]') }} | |
build_type: ${{ github.event_name == 'schedule' && fromJSON('["RelWithDebInfo ", "Debug"]') || fromJSON('["RelWithDebInfo"]') }} | |
with_tracing: ${{ github.event_name == 'schedule' && fromJSON('["True"]') || fromJSON('["False"]') }} | |
exclude: | |
- os: "ubuntu-20.04" | |
build_type: "Debug" | |
name: "${{matrix.os}} ${{matrix.build_type}} unity_build=${{matrix.use_unity_build}} with_tracing=${{matrix.with_tracing}}" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- name: install conan | |
run: | | |
pip install conan==1.64.0 | |
conan --version | |
- name: add remotes | |
run: | | |
conan remote list | |
python scripts/add_conan_remotes.py | |
conan remote list | |
- name: conan login | |
run: conan user ci_github_actions -p -r=framebffr | |
env: | |
CONAN_PASSWORD: ${{ secrets.CONAN_PASSWORD }} | |
- name: setup conan profile | |
if: runner.os == 'Linux' | |
run: | | |
conan profile new default --detect | |
conan profile update settings.compiler.libcxx=libstdc++11 default | |
- name: install apt packages | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt-get update | |
sudo apt-get install libgl-dev xorg-dev libx11-xcb-dev libxcb-render0-dev libxcb-render-util0-dev libxcb-xkb-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shape0-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb-xinerama0-dev xkb-data libx11-dev libx11-xcb-dev libfontenc-dev libice-dev libsm-dev libxau-dev libxaw7-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxdmcp-dev libxext-dev libxfixes-dev libxft-dev libxi-dev libxinerama-dev libxkbfile-dev libxmu-dev libxmuu-dev libxpm-dev libxrandr-dev libxrender-dev libxres-dev libxss-dev libxt-dev libxtst-dev libxv-dev libxvmc-dev libxxf86vm-dev xtrans-dev libxcb-render0-dev libxcb-render-util0-dev libxcb-xkb-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shape0-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb-xinerama0-dev xkb-data libxcb-dri3-dev uuid-dev libxcb-util-dev libxcb-cursor-dev | |
- name: install cato client | |
run: | | |
pip install https://cato.frmbffr.com/static/catoclient-0.0.0-py3-none-any.whl | |
cato --h | |
- name: prepare build | |
run: mkdir build | |
- name: run CMake | |
working-directory: build | |
run: cmake .. -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DCMAKE_UNITY_BUILD=${{matrix.use_unity_build}} -DCMAKE_UNITY_BUILD_BATCH_SIZE=16 -DCRAYG_USE_COMMIT_HASH=ON -DCRAYG_ENABLE_TRACING=${{matrix.with_tracing}} | |
- name: upload dependencies | |
run: conan upload "*" --all --confirm -r=framebffr --parallel | |
- name: build | |
working-directory: build | |
if: runner.os != 'Windows' | |
run: make -j 4 | |
- name: build | |
if: runner.os == 'Windows' | |
working-directory: build | |
run: cmake --build . --config ${{matrix.build_type}} -- /M:%NUMBER_OF_PROCESSORS% | |
shell: cmd | |
- name: switch to nightly branch | |
if: github.event_name == 'schedule' | |
run: git checkout -b nightly | |
- name: run tests | |
working-directory: build | |
run: ctest -C ${{matrix.build_type}} -V | |
env: | |
CATO_API_TOKEN: ${{secrets.CATO_API_TOKEN}} | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
GITHUB_JOB_NAME: "${{matrix.os}} ${{matrix.build_type}} unity_build=${{matrix.use_unity_build}} with_tracing=${{matrix.with_tracing}}" | |
- name: create package | |
working-directory: build | |
run: cmake --build . --config ${{matrix.build_type}} --target createDistribution |