|
| 1 | +name: CMake Build and Test |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + pull_request: |
| 6 | + workflow_dispatch: |
| 7 | + |
| 8 | +jobs: |
| 9 | + build-and-test: |
| 10 | + name: build+test (${{ matrix.os }}) |
| 11 | + runs-on: ${{ matrix.os }} |
| 12 | + timeout-minutes: 20 |
| 13 | + strategy: |
| 14 | + fail-fast: false |
| 15 | + matrix: |
| 16 | + os: |
| 17 | + - ubuntu-latest |
| 18 | + - macos-latest |
| 19 | + - windows-latest |
| 20 | + env: |
| 21 | + BUILD_CONFIG: Release |
| 22 | + steps: |
| 23 | + - uses: actions/checkout@v4 |
| 24 | + |
| 25 | + - name: Configure (Windows, clang-cl) |
| 26 | + if: runner.os == 'Windows' |
| 27 | + run: cmake -S . -B build -T ClangCL -DCMAKE_BUILD_TYPE=${{ env.BUILD_CONFIG }} -DMINICC_BUILD_SHARED_LIBTCC=ON -DMINICC_BUILD_WASM32_TCC=OFF -DMINICC_ENABLE_TESTING=ON |
| 28 | + |
| 29 | + - name: Configure |
| 30 | + if: runner.os != 'Windows' |
| 31 | + run: cmake -S . -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_CONFIG }} -DMINICC_BUILD_SHARED_LIBTCC=ON -DMINICC_BUILD_WASM32_TCC=OFF -DMINICC_ENABLE_TESTING=ON |
| 32 | + |
| 33 | + - name: Build |
| 34 | + run: cmake --build build --config ${{ env.BUILD_CONFIG }} --parallel |
| 35 | + |
| 36 | + - name: Run tests |
| 37 | + run: ctest --test-dir build -C ${{ env.BUILD_CONFIG }} --output-on-failure |
| 38 | + |
| 39 | + wasm-backend: |
| 40 | + name: wasm backend (ubuntu-latest) |
| 41 | + runs-on: ubuntu-latest |
| 42 | + timeout-minutes: 20 |
| 43 | + env: |
| 44 | + BUILD_CONFIG: Release |
| 45 | + steps: |
| 46 | + - uses: actions/checkout@v4 |
| 47 | + |
| 48 | + - uses: actions/setup-node@v4 |
| 49 | + with: |
| 50 | + node-version: "20" |
| 51 | + |
| 52 | + - name: Configure (wasm enabled) |
| 53 | + run: cmake -S . -B build-wasm -DCMAKE_BUILD_TYPE=${{ env.BUILD_CONFIG }} -DMINICC_BUILD_SHARED_LIBTCC=ON -DMINICC_BUILD_WASM32_TCC=ON -DMINICC_ENABLE_TESTING=ON |
| 54 | + |
| 55 | + - name: Build (wasm enabled) |
| 56 | + run: cmake --build build-wasm --config ${{ env.BUILD_CONFIG }} --parallel |
| 57 | + |
| 58 | + - name: Verify wasm tests are discovered |
| 59 | + run: | |
| 60 | + ctest --test-dir build-wasm -N |
| 61 | + ctest --test-dir build-wasm -N | grep -q "minicc.wasm." |
| 62 | +
|
| 63 | + - name: Run wasm backend tests |
| 64 | + run: ctest --test-dir build-wasm -C ${{ env.BUILD_CONFIG }} -R "^minicc\\.wasm\\." --output-on-failure |
0 commit comments