diff options
author | Raun Krisch <raun.krisch@gmail.com> | 2021-06-30 18:52:20 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-30 18:52:20 +0300 |
commit | ddf3230c14c71e81fc0eae9b781cc4bcc2d1f0f5 (patch) | |
tree | cc444b74e86b067d2f2c5c31965d389b937ee136 | |
parent | e3bc1b14ebb03cf9202ea048ad866c06156bf2b8 (diff) | |
parent | 292387ae143e2712b14d79a7a48bd784fcf070c8 (diff) |
Merge pull request #222 from kpet/github-actions
Add CI using Github actions and update README
-rw-r--r-- | .github/workflows/presubmit.yml | 37 | ||||
-rw-r--r-- | README.md | 13 | ||||
-rwxr-xr-x | tools/buildHeaders/bin/makeHeaders | 2 |
3 files changed, 50 insertions, 2 deletions
diff --git a/.github/workflows/presubmit.yml b/.github/workflows/presubmit.yml new file mode 100644 index 0000000..d9c25fa --- /dev/null +++ b/.github/workflows/presubmit.yml @@ -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 @@ -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, diff --git a/tools/buildHeaders/bin/makeHeaders b/tools/buildHeaders/bin/makeHeaders index 0ca0b2f..7b4959e 100755 --- a/tools/buildHeaders/bin/makeHeaders +++ b/tools/buildHeaders/bin/makeHeaders @@ -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.* |