-
Notifications
You must be signed in to change notification settings - Fork 2
56 lines (55 loc) · 1.67 KB
/
presubmit.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Presubmit
on: [push, pull_request]
jobs:
format:
name: Code formatting check
runs-on: ubuntu-20.04
steps:
- name: Install packages
run: sudo apt-get install -y clang-format
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Check format
run: |
./tests/check-format.sh
build:
name: Build ${{ matrix.os }} ${{ matrix.config }}
needs: format
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, macos-latest, windows-latest]
config: [Debug,Release]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
- name: Setup Ninja
uses: seanmiddleditch/gha-setup-ninja@master
- name: Setup ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
variant: sccache
key: ${{ matrix.os }}-${{ matrix.config }}
- name: Configure
shell: bash
run: |
set -ex
mkdir build
cd build
mkdir install
cmake .. -G Ninja \
-DSPIRV_WERROR=OFF \
-DCMAKE_BUILD_TYPE=${{ matrix.config }} \
-DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache \
-DCMAKE_INSTALL_PREFIX='${{ github.workspace }}/build/install'
- name: Build
run: cmake --build ./build --config ${{ matrix.config }} -j3
- name: Install
run: cmake --install ./build
- uses: actions/upload-artifact@v3
with:
name: spirv2clc-${{ matrix.os }}-${{ matrix.config }}
path: ${{ github.workspace }}/build/install