name: examples CI on: workflow_dispatch: push: branches: - main paths-ignore: - '**/*.md' pull_request: branches: - main defaults: run: shell: pwsh jobs: windows-VC: runs-on: windows-latest steps: - name: deploy sources uses: actions/checkout@v3 with: path: examples - name: build/install examples run: | cd examples mkdir build mkdir install cmake -DCMAKE_INSTALL_PREFIX="$pwd/install" ` -B ./build -A x64 -T host=x64 . cmake --build ./build -j ` --config RelWithDebInfo ` --target install - name: Upload Artifact uses: actions/upload-artifact@v4 with: name: WindowsVC path: ./examples/install/ windows-clang: runs-on: windows-latest steps: - name: deploy sources uses: actions/checkout@v3 with: path: examples - name: build/install examples id: build continue-on-error: true run: | $ErrorActionPreference = 'Continue' cd examples mkdir build mkdir install cmake -DCMAKE_INSTALL_PREFIX="$pwd/install" ` -B ./build -A x64 -T ClangCL . cmake --build ./build -j ` --config RelWithDebInfo ` --target install | Tee-Object -Variable cmake_log if($LASTEXITCODE) { $pattern = 'clang-cl : message : diagnostic msg: (.*) \[' $paths = ($cmake_log | sls -AllMatches -Pattern $pattern).Matches.Groups | ? { $_.GetType().Name -eq 'Group' } | select -ExpandProperty Value $paths = $paths -join "`r" "reports_paths=$paths" | Out-File -FilePath $Env:GITHUB_OUTPUT -Append -Encoding OEM Get-Content $Env:GITHUB_OUTPUT exit 1 } - name: Upload error info artifact on compiler failure if: ${{ steps.build.outcome == 'failure' }} uses: actions/upload-artifact@v4 with: name: WindowsClangErrorReports path: | ${{ steps.build.outputs.reports_paths }} - name: if: ${{ steps.build.outcome == 'failure' }} uses: actions/github-script@v3 with: script: | core.setFailed('Build failed and error reports uploaded') - name: Upload Artifact if: ${{ steps.build.outcome == 'success' }} uses: actions/upload-artifact@v4 with: name: WindowsClang path: ./examples/install/ ubuntu-gcc: runs-on: ubuntu-latest steps: - name: deploy sources uses: actions/checkout@v3 with: path: examples - name: build/install examples run: | cd examples mkdir build mkdir install cmake -DCMAKE_INSTALL_PREFIX="$pwd/install" ` -DCMAKE_BUILD_TYPE=RelWithDebInfo ` -B ./build . cmake --build ./build -j --target install - name: Upload Artifact uses: actions/upload-artifact@v4 with: name: UbuntuGCC path: ./examples/install/ ubuntu-clang: runs-on: ubuntu-latest steps: - name: deploy sources uses: actions/checkout@v3 with: path: examples - name: build/install examples env: CXX: clang++ run: | cd examples mkdir build mkdir install cmake -DCMAKE_INSTALL_PREFIX="$pwd/install" ` -DCMAKE_BUILD_TYPE=RelWithDebInfo ` -B ./build . cmake --build ./build -j --target install - name: Upload Artifact uses: actions/upload-artifact@v4 with: name: UbuntuClang path: ./examples/install/ macos-clang: runs-on: macos-latest steps: - name: deploy sources uses: actions/checkout@v3 with: path: examples - name: build/install examples run: | cd examples mkdir build mkdir install cmake -DCMAKE_INSTALL_PREFIX="$pwd/install" ` -DCMAKE_BUILD_TYPE=RelWithDebInfo ` -B ./build . cmake --build ./build -j --target install - name: Upload Artifact uses: actions/upload-artifact@v4 with: name: MacOSClang path: ./examples/install/ # vim: ft=yaml cursorcolumn