mirror of
https://gitee.com/openharmony/third_party_spirv-headers
synced 2024-11-22 23:20:03 +00:00
Add CI using Github actions and update README
- Run on Linux, macOS and Windows - Check that the headers install works - Check the example can be built - Check the header generation tool can be built - Generate headers and check they match the committed files - Mention the requirement to install the header generation tool in README Change-Id: I8385b3931064ad677d7aa49b2514cea9b4602168 Signed-off-by: Kevin Petit <kevin.petit@arm.com>
This commit is contained in:
parent
f95c3b3761
commit
292387ae14
37
.github/workflows/presubmit.yml
vendored
Normal file
37
.github/workflows/presubmit.yml
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
name: Presubmit
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build ${{ matrix.os }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install Ubuntu packages
|
||||
if: matrix.os == 'ubuntu-latest'
|
||||
run: sudo apt install -y dos2unix
|
||||
- name: Install macOS packages
|
||||
if: matrix.os == 'macos-latest'
|
||||
run: brew install dos2unix
|
||||
- name: Build
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DCMAKE_INSTALL_PREFIX=install ..
|
||||
cmake --build . --target install
|
||||
- name: Build spec tools
|
||||
run: |
|
||||
cd tools/buildHeaders
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ..
|
||||
cmake --build . --target install
|
||||
- name: Build headers
|
||||
run: |
|
||||
cd tools/buildHeaders
|
||||
./bin/makeHeaders
|
||||
- name: Check generated headers
|
||||
run: git diff --exit-code
|
13
README.md
13
README.md
@ -140,10 +140,21 @@ and can be used to test a PR, or even to include the results in the PR.
|
||||
This is not required though.
|
||||
|
||||
The header-generation project is under the `tools/buildHeaders` directory.
|
||||
Use CMake to build the project, in a `build` subdirectory (under `tools/buildHeaders`).
|
||||
Use CMake to build and install the project, in a `build` subdirectory (under `tools/buildHeaders`).
|
||||
There is then a bash script at `bin/makeHeaders` that shows how to use the built
|
||||
header-generator binary to generate the headers from the JSON grammar.
|
||||
(Execute `bin/makeHeaders` from the `tools/buildHeaders` directory.)
|
||||
Here's a complete example:
|
||||
|
||||
```
|
||||
cd tools/buildHeaders
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ..
|
||||
cmake --build . --target install
|
||||
cd ..
|
||||
./bin/makeHeaders
|
||||
```
|
||||
|
||||
Notes:
|
||||
- this generator is used in a broader context within Khronos to generate the specification,
|
||||
|
@ -4,4 +4,4 @@ python3 bin/makeExtinstHeaders.py
|
||||
|
||||
cd ../../include/spirv/unified1
|
||||
../../../tools/buildHeaders/build/install/bin/buildSpvHeaders -H spirv.core.grammar.json
|
||||
dos2unix spirv.* SpirV.* spv.*
|
||||
dos2unix spirv.* spv.*
|
||||
|
Loading…
Reference in New Issue
Block a user