• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021 Valve Corporation
2# Copyright (c) 2021 LunarG, Inc.
3
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8#     http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16# Author: Lenny Komow <lenny@lunarg.com>
17
18name: CI Build
19
20on:
21    push:
22    pull_request:
23        branches:
24            - master
25
26jobs:
27    linux:
28        runs-on: ${{matrix.os}}
29
30        strategy:
31            matrix:
32                cc: [ gcc, clang ]
33                cxx: [ g++, clang++ ]
34                config: [ Debug, Release ]
35                os: [ ubuntu-18.04, ubuntu-20.04 ]
36                exclude:
37                    - cc: gcc
38                      cxx: clang++
39                    - cc: clang
40                      cxx: g++
41
42        steps:
43            - uses: actions/checkout@v2
44            - uses: actions/setup-python@v2
45              with:
46                python-version: '3.7'
47            - run: sudo apt update
48            - run: sudo apt install libwayland-dev libxrandr-dev
49
50            - name: Generate build files
51              run: cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=${{matrix.config}} -DBUILD_TESTS=On -DUPDATE_DEPS=ON -DTEST_USE_ADDRESS_SANITIZER=ON
52              env:
53                CC: ${{matrix.cc}}
54                CXX: ${{matrix.cxx}}
55
56            - name: Build the loader
57              run: make -C build
58
59            - name: Run regression tests
60              working-directory: ./build
61              run: ctest --output-on-failure
62
63            - name: Verify generated source files
64              run: python scripts/generate_source.py --verify external/Vulkan-Headers/registry
65
66            - name: Verify code formatting with clang-format
67              run: ./scripts/check_code_format.sh
68
69            - name: Verify commit message formatting
70              run: ./scripts/check_commit_message_format.sh
71
72    windows:
73        runs-on: ${{matrix.os}}
74
75        strategy:
76            matrix:
77                arch: [ Win32, x64 ]
78                config: [ Debug, Release ]
79                os: [ windows-latest ]
80
81        steps:
82            - uses: actions/checkout@v2
83            - uses: actions/setup-python@v2
84              with:
85                python-version: '3.7'
86
87            - name: Generate build files
88              run: cmake -S. -Bbuild -A${{matrix.arch}} -DBUILD_TESTS=On -DUPDATE_DEPS=ON
89
90            - name: Build the loader
91              run: cmake --build ./build --config ${{matrix.config}}
92
93            - name: Run regression tests
94              working-directory: ./build
95              run: ctest --output-on-failure
96
97            - name: Verify generated source files
98              run: python scripts/generate_source.py --verify external/Vulkan-Headers/registry
99
100    mac:
101        runs-on: macos-latest
102
103        strategy:
104            matrix:
105                config: [ Debug, Release ]
106
107        steps:
108            - uses: actions/checkout@v2
109            - uses: actions/setup-python@v2
110              with:
111                python-version: '3.7'
112
113            - name: Generate build files
114              run: cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=${{matrix.config}} -DBUILD_TESTS=On -DUPDATE_DEPS=ON -DTEST_USE_ADDRESS_SANITIZER=ON
115
116            - name: Build the loader
117              run: make -C build
118
119            - name: Run regression tests
120              working-directory: ./build
121              run: ctest --output-on-failure
122
123    gn:
124        runs-on: ubuntu-18.04
125
126        strategy:
127            matrix:
128                config: [ Debug, Release ]
129
130        steps:
131            - uses: actions/checkout@v2
132
133            - name: Get depot tools
134              run: |
135                git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git depot_tools
136                echo "$GITHUB_WORKSPACE/depot_tools" >> $GITHUB_PATH
137
138            - name: Fetch and install headers
139              run: ./build-gn/update_deps.sh
140
141            - name: Generate build files
142              run: gn gen out/${{matrix.config}} --args="is_debug=true"
143              if: matrix.config != 'Release'
144
145            - name: Generate build files
146              run: gn gen out/${{matrix.config}} --args="is_debug=false"
147              if: matrix.config == 'Release'
148
149            - name: Build the loader
150              run: ninja -C out/${{matrix.config}}
151