Skip to content

CI

CI #295

Workflow file for this run

name: CI
on:
push:
pull_request:
branches: [master]
schedule:
- cron: '0 6 * * 6'
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- crystal: nightly
os: ubuntu-latest
- crystal: latest
os: macos-latest
- os: windows-latest
runs-on: ${{matrix.os}}
steps:
- name: Install Crystal
uses: oprypin/install-crystal@v1
with:
crystal: ${{matrix.crystal}}
- name: Download source
uses: actions/checkout@v2
with:
submodules: recursive
fetch-depth: 0
- name: Re-generate sources
if: runner.os != 'Windows'
run: |
crystal generate.cr
crystal tool format src
- name: Validate freshness of generated files
if: matrix.crystal == 'latest'
run: |
git diff --exit-code
- name: Install shards
run: |
shards install --skip-postinstall
- name: Build cimgui
working-directory: ./cimgui
run: |
cmake -DCMAKE_CXX_FLAGS='-DIMGUI_USE_WCHAR32' .
cmake --build . -j4
- name: Build docs
run: |
tools/build_docs.sh
- name: Set up environment
if: runner.os != 'Windows'
working-directory: ./cimgui
run: |
ln -s {,lib}$(ls cimgui.so cimgui.dylib)
echo "LIBRARY_PATH=$(pwd)" >>$GITHUB_ENV
echo "LD_LIBRARY_PATH=$(pwd)" >>$GITHUB_ENV
- name: Set up environment
if: runner.os == 'Windows'
run: |
echo "LIB=$(pwd)\cimgui\Debug;${env:LIB}" >>${env:GITHUB_ENV}
- name: Run example
if: runner.os == 'Linux'
run: |
crystal run examples/test.cr
- name: Build demo
run: |
crystal build --cross-compile examples/demo_sfml.cr
- name: Deploy docs to gh-pages
if: github.event_name == 'push' && github.ref == 'refs/heads/master' && runner.os == 'Linux'
uses: oprypin/push-to-gh-pages@v3
with:
publish_dir: ./docs
- name: Check formatting
if: matrix.crystal == 'latest'
run: |
crystal tool format --check