Merge pull request #481 from pedro-w/issue-477 #30
This file contains hidden or 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: CI | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - main | |
| - develop | |
| pull_request: | |
| branches: | |
| - master | |
| - main | |
| - develop | |
| workflow_dispatch: | |
| jobs: | |
| formatter: | |
| name: Code Formatting Check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: 'recursive' | |
| - name: Check format | |
| uses: DoozyX/clang-format-lint-action@v0.12 | |
| with: | |
| source: 'libs' | |
| extensions: 'h,c' | |
| style: file | |
| clangFormatVersion: 12 | |
| unix: | |
| name: Unix Build (${{ matrix.os }} - ${{ matrix.build_type }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ macOS-latest, ubuntu-latest ] | |
| build_type: [ Debug, Release ] | |
| include: | |
| # Test on Apple Silicon | |
| - os: macos-14 | |
| build_type: Release | |
| # Test on older macOS | |
| - os: macos-12 | |
| build_type: Release | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: 'recursive' | |
| - name: Setup cmake | |
| uses: jwlawson/actions-setup-cmake@v1.14 | |
| - name: Build | |
| run: | | |
| mkdir build | |
| cd build | |
| cmake -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} .. | |
| make -j$([ "$(uname)" = "Darwin" ] && sysctl -n hw.ncpu || nproc) | |
| - name: Install | |
| run: | | |
| cd build | |
| sudo make install | |
| - name: Test | |
| run: | | |
| cd build | |
| ./_build/binaries/io --version | |
| ./_build/binaries/io ../libs/iovm/tests/correctness/run.io | |
| timeout-minutes: 10 | |
| - name: Test Samples | |
| if: matrix.build_type == 'Release' | |
| run: | | |
| cd build | |
| for sample in ../samples/misc/*.io; do | |
| if [ -f "$sample" ]; then | |
| echo "Testing: $(basename $sample)" | |
| timeout 5s ./_build/binaries/io "$sample" || echo "Sample timed out or failed: $sample" | |
| fi | |
| done | |
| windows: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v2 | |
| with: | |
| submodules: 'recursive' | |
| - name: Build | |
| run: | | |
| mkdir build | |
| cd build | |
| cmake -G"MinGW Makefiles" .. | |
| make | |
| - name: Install | |
| run: | | |
| cd build | |
| make install | |
| - name: Test | |
| run: | | |
| cd build | |
| & _build/binaries/io_static.exe --% --version | |
| & _build/binaries/io_static.exe --% ../libs/iovm/tests/correctness/run.io |