Upgrade GitHub Actions checkout and upload artifact actions to v4 #2
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: Build Matrix | |
| on: | |
| push: | |
| branches: [ main, develop ] | |
| pull_request: | |
| branches: [ main, develop ] | |
| jobs: | |
| build: | |
| name: Build on ${{ matrix.os }} with ${{ matrix.compiler }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest] | |
| compiler: [gcc, clang] | |
| build_type: [Release, Debug] | |
| exclude: | |
| # Skip some combinations to save CI time | |
| - os: macos-latest | |
| build_type: Debug | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install dependencies (Ubuntu) | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y cmake build-essential clang | |
| - name: Install dependencies (macOS) | |
| if: runner.os == 'macOS' | |
| run: | | |
| brew install cmake | |
| - name: Configure build | |
| env: | |
| CC: ${{ matrix.compiler }} | |
| CXX: ${{ matrix.compiler == 'gcc' && 'g++' || 'clang++' }} | |
| run: | | |
| mkdir -p build | |
| cd build | |
| cmake -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} .. | |
| - name: Build | |
| run: | | |
| cd build | |
| cmake --build . --parallel --config ${{ matrix.build_type }} | |
| - name: Run tests | |
| run: | | |
| cd build | |
| cmake --build . --target test_parity --parallel | |
| ./tests/test_parity | |
| - name: Build examples | |
| run: | | |
| cd build | |
| cmake --build . --target csvtest --parallel | |
| cmake --build . --target csvinfo --parallel | |
| cmake --build . --target csvfix --parallel | |
| cmake --build . --target csvvalid --parallel | |
| summary: | |
| name: Build Summary | |
| runs-on: ubuntu-latest | |
| needs: build | |
| if: always() | |
| steps: | |
| - name: ✅ Build Matrix Successful | |
| if: ${{ needs.build.result == 'success' }} | |
| run: echo "All builds passed on all platforms!" | |
| - name: ❌ Build Matrix Failed | |
| if: ${{ needs.build.result == 'failure' }} | |
| run: exit 1 |