Skip to content

Feature/stdout

Feature/stdout #237

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Examples
on:
push:
branches: ["main", "devel"]
pull_request:
branches: ["main", "devel"]
permissions:
contents: read
env:
DAN_NOSTATUS: 1
jobs:
build:
strategy:
matrix:
config:
- name: Ubuntu
# NOTE: only ubunut does the full examples build
# because others are too long on GH worflow
os: ubuntu-latest
shell: bash
with_conan: false
targets: |
dan.io.spdlog-example \
dan.io.mbedtls-example \
dan.io.catch2-example
- name: Windows MSVC
os: windows-latest
shell: bash
with_conan: false
targets: |
libraries.use-simple-lib \
dan.io.mbedtls-example \
dan.io.catch2-example
- name: Windows MINGW64
os: windows-latest
msystem: MINGW64
shell: bash
scan_paths: -p D:\\msys64\\mingw64\\bin
with_conan: false
targets: |
libraries.use-simple-lib \
dan.io.mbedtls-example \
dan.io.catch2-example
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
defaults:
run:
shell: ${{ matrix.config.shell }}
steps:
- uses: actions/checkout@v3
- uses: msys2/setup-msys2@v2
if: ${{ matrix.config.msystem }}
with:
location: D:\\
msystem: ${{ matrix.config.msystem }}
# NOTE: we install defaul msys-gcc because python yarl library does not compile with mingw64-gcc,
# while fmt (built within examples) does not compile with defaul msys-gcc :)
install: >-
mingw-w64-x86_64-gcc
mingw-w64-x86_64-make
- name: Set up Python 3.11
uses: actions/setup-python@v3
with:
python-version: "3.11"
- name: Configure git
run: |
# since some examples uses git to apply patches, it requires to be configured
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions"
- name: Install Conan
if: ${{ matrix.config.with_conan }}
run: |
python -m pip install conan
conan profile detect
- name: Install dan
run: |
python -m pip install --upgrade pip
python -m pip install .
- name: Scan toolchains
run: |
dan scan-toolchains -v ${{ matrix.config.scan_paths }}
- name: Configure
run: |
cd examples
dan-io configure -s github.api_token=${{ secrets.GITHUB_TOKEN }}
dan configure -v \
-t default \
-s install.destination=dist \
-o dan-examples.cxx.with_conan=${{ matrix.config.with_conan }}
- name: Build
run: |
cd examples
dan build -v ${{ matrix.config.targets }}
- name: Re-build
run: |
cd examples
dan build -v ${{ matrix.config.targets }}
- name: Test
run: |
cd examples
dan test -v ${{ matrix.config.targets }}
- name: Install
run: |
cd examples
dan install -v dev ${{ matrix.config.targets }}