mirror of
https://github.com/KhronosGroup/SPIRV-Tools
synced 2024-10-18 11:10:05 +00:00
987a5f1367
Before, we did set cxx version to c++17 using COPTS in our bazel files. This was wrong, and part of the dependencies were then built with the default standard version. This was not an issue until we moved to c++17. Then, we decided to use the bazel --cxxopt=-std=c++17, but this was only valid for nix platforms. The last option left is to ask the user to specify the standard when building using bazel.
41 lines
1.2 KiB
YAML
41 lines
1.2 KiB
YAML
name: Build and Test with Bazel
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- 'main'
|
|
pull_request:
|
|
|
|
jobs:
|
|
build:
|
|
timeout-minutes: 120
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
|
|
runs-on: ${{matrix.os}}
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: '0'
|
|
- name: Download dependencies
|
|
run: python3 utils/git-sync-deps
|
|
- name: Mount Bazel cache
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: ~/.bazel/cache
|
|
key: bazel-cache-${{ runner.os }}
|
|
- name: Build All (Windows)
|
|
if: ${{matrix.os == 'windows-latest' }}
|
|
run: bazel --output_user_root=~/.bazel/cache build --cxxopt=/std:c++17 //...
|
|
- name: Test All (Windows)
|
|
if: ${{matrix.os == 'windows-latest' }}
|
|
run: bazel --output_user_root=~/.bazel/cache test --cxxopt=/std:c++17 //...
|
|
- name: Build All (Linux, MacOS)
|
|
if: ${{ matrix.os != 'windows-latest' }}
|
|
run: bazel --output_user_root=~/.bazel/cache build --cxxopt=-std=c++17 //...
|
|
- name: Test All (Linux, MacOS)
|
|
if: ${{ matrix.os != 'windows-latest' }}
|
|
run: bazel --output_user_root=~/.bazel/cache test --cxxopt=-std=c++17 //...
|