Skip to content

CI

CI #355

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@v4
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 --color --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: 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: Re-generate sources with docs
if: runner.os == 'Linux'
run: |
crystal generate.cr --with-docs
- name: Build docs
if: runner.os == 'Linux'
run: |
tools/build_docs.sh
- name: Upload docs to GitHub Pages
if: runner.os == 'Linux'
uses: actions/upload-pages-artifact@v2
with:
path: docs
deploy-docs:
if: github.event_name == 'push' && github.ref_name == github.event.repository.default_branch
needs: build
permissions:
pages: write
id-token: write
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}