diff options
| -rw-r--r-- | .github/actions/format-setup/action.yml | 16 | ||||
| -rw-r--r-- | .github/workflows/benchmark.yml | 24 | ||||
| -rw-r--r-- | .github/workflows/ci.yml | 20 | ||||
| -rw-r--r-- | .github/workflows/compile-regression-test.yml | 70 | ||||
| -rw-r--r-- | .github/workflows/ensure-pr-label.yml | 10 | ||||
| -rw-r--r-- | .github/workflows/falcor-compiler-perf-test.yml | 118 | ||||
| -rw-r--r-- | .github/workflows/falcor-test.yml | 122 | ||||
| -rw-r--r-- | .github/workflows/push-benchmark-results.yml | 20 | ||||
| -rw-r--r-- | .github/workflows/release-linux-glibc-2-17.yml | 6 | ||||
| -rw-r--r-- | .github/workflows/release.yml | 31 | ||||
| -rw-r--r-- | .github/workflows/slash-command-dispatch.yml | 2 | ||||
| -rw-r--r-- | .github/workflows/vk-gl-cts-nightly.yml | 156 | ||||
| -rw-r--r-- | CMakePresets.json | 24 | ||||
| -rw-r--r-- | docs/scripts/release-note.sh | 127 | ||||
| -rwxr-xr-x | external/build-llvm.sh | 38 | ||||
| -rwxr-xr-x | external/bump-glslang.sh | 30 | ||||
| -rwxr-xr-x | extras/formatting.sh | 39 | ||||
| -rw-r--r-- | extras/macos-notarize.json | 12 | ||||
| -rw-r--r-- | extras/macos-sign.json | 20 |
19 files changed, 467 insertions, 418 deletions
diff --git a/.github/actions/format-setup/action.yml b/.github/actions/format-setup/action.yml index d99be4d3a..1028ce6bb 100644 --- a/.github/actions/format-setup/action.yml +++ b/.github/actions/format-setup/action.yml @@ -19,3 +19,19 @@ runs: https://github.com/shader-slang/slang-binaries/raw/306d22efc0f5f72c7230b0b6b7c99f03c46995bd/clang-format/x86_64-linux/bin/clang-format chmod +x "$tmpdir/clang-format" echo "$tmpdir" >> $GITHUB_PATH + + - name: install prettier + shell: bash + run: | + npm install -g prettier@3.3.3 + echo "$(npm bin -g)" >> $GITHUB_PATH + + - name: install shfmt + shell: bash + run: | + tmpdir=$(mktemp -d) + curl -L -H "Authorization: token ${{github.token}}" \ + -o "$tmpdir/shfmt" \ + https://github.com/mvdan/sh/releases/download/v3.10.0/shfmt_v3.10.0_linux_amd64 + chmod +x "$tmpdir/shfmt" + echo "$tmpdir" >> $GITHUB_PATH diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index eb90492f3..245667b46 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -4,17 +4,17 @@ on: push: branches: [master] paths-ignore: - - 'docs/**' - - 'LICENCE' - - 'CONTRIBUTION.md' - - 'README.md' + - "docs/**" + - "LICENCE" + - "CONTRIBUTION.md" + - "README.md" pull_request: branches: [master] paths-ignore: - - 'docs/**' - - 'LICENCE' - - 'CONTRIBUTION.md' - - 'README.md' + - "docs/**" + - "LICENCE" + - "CONTRIBUTION.md" + - "README.md" concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true @@ -25,8 +25,8 @@ jobs: steps: - uses: actions/checkout@v3 with: - submodules: 'recursive' - fetch-depth: '0' + submodules: "recursive" + fetch-depth: "0" - name: Common setup uses: ./.github/actions/common-setup with: @@ -41,8 +41,8 @@ jobs: cmake --workflow --preset release - uses: actions/checkout@v3 with: - repository: 'shader-slang/MDL-SDK' - path: 'external/MDL-SDK' + repository: "shader-slang/MDL-SDK" + path: "external/MDL-SDK" - name: Run benchmark run: | cd tools/benchmark diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6f0aa2d93..56e1df6b0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,17 +4,17 @@ on: push: branches: [master] paths-ignore: - - 'docs/**' - - 'LICENCE' - - 'CONTRIBUTION.md' - - 'README.md' + - "docs/**" + - "LICENCE" + - "CONTRIBUTION.md" + - "README.md" pull_request: branches: [master] paths-ignore: - - 'docs/**' - - 'LICENCE' - - 'CONTRIBUTION.md' - - 'README.md' + - "docs/**" + - "LICENCE" + - "CONTRIBUTION.md" + - "README.md" concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true @@ -87,8 +87,8 @@ jobs: steps: - uses: actions/checkout@v3 with: - submodules: 'recursive' - fetch-depth: '0' + submodules: "recursive" + fetch-depth: "0" - name: Setup uses: ./.github/actions/common-setup with: diff --git a/.github/workflows/compile-regression-test.yml b/.github/workflows/compile-regression-test.yml index f1809ea71..da5656d7f 100644 --- a/.github/workflows/compile-regression-test.yml +++ b/.github/workflows/compile-regression-test.yml @@ -2,19 +2,19 @@ name: Compile Regression-Test on: push: - branches: [ master ] + branches: [master] paths-ignore: - - 'docs/**' - - 'LICENCE' - - 'CONTRIBUTION.md' - - 'README.md' + - "docs/**" + - "LICENCE" + - "CONTRIBUTION.md" + - "README.md" pull_request: - branches: [ master ] + branches: [master] paths-ignore: - - 'docs/**' - - 'LICENCE' - - 'CONTRIBUTION.md' - - 'README.md' + - "docs/**" + - "LICENCE" + - "CONTRIBUTION.md" + - "README.md" concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true @@ -40,28 +40,28 @@ jobs: run: shell: bash steps: - - uses: actions/checkout@v3 - with: - submodules: 'recursive' - fetch-depth: '0' - - name: Setup - uses: ./.github/actions/common-setup - with: - os: ${{matrix.os}} - compiler: ${{matrix.compiler}} - platform: ${{matrix.platform}} - config: ${{matrix.config}} - build-llvm: true - - name: Build Slang - run: | - cmake --preset default --fresh \ - -DSLANG_SLANG_LLVM_FLAVOR=USE_SYSTEM_LLVM \ - -DCMAKE_COMPILE_WARNING_AS_ERROR=${{matrix.warnings-as-errors}} \ - -DSLANG_ENABLE_CUDA=1 - cmake --workflow --preset "${{matrix.config}}" - - name: Run compile and validation test - run: | - cp -r /c/slang_compile_test_suite_a . - cd slang_compile_test_suite_a - export SLANGC_PATH="$bin_dir/slangc.exe" - bash ./compile_all_slang.sh + - uses: actions/checkout@v3 + with: + submodules: "recursive" + fetch-depth: "0" + - name: Setup + uses: ./.github/actions/common-setup + with: + os: ${{matrix.os}} + compiler: ${{matrix.compiler}} + platform: ${{matrix.platform}} + config: ${{matrix.config}} + build-llvm: true + - name: Build Slang + run: | + cmake --preset default --fresh \ + -DSLANG_SLANG_LLVM_FLAVOR=USE_SYSTEM_LLVM \ + -DCMAKE_COMPILE_WARNING_AS_ERROR=${{matrix.warnings-as-errors}} \ + -DSLANG_ENABLE_CUDA=1 + cmake --workflow --preset "${{matrix.config}}" + - name: Run compile and validation test + run: | + cp -r /c/slang_compile_test_suite_a . + cd slang_compile_test_suite_a + export SLANGC_PATH="$bin_dir/slangc.exe" + bash ./compile_all_slang.sh diff --git a/.github/workflows/ensure-pr-label.yml b/.github/workflows/ensure-pr-label.yml index 8db5b6057..cf5215063 100644 --- a/.github/workflows/ensure-pr-label.yml +++ b/.github/workflows/ensure-pr-label.yml @@ -3,10 +3,10 @@ on: pull_request: types: [opened, labeled, unlabeled, synchronize] paths-ignore: - - 'docs/**' - - 'LICENCE' - - 'CONTRIBUTION.md' - - 'README.md' + - "docs/**" + - "LICENCE" + - "CONTRIBUTION.md" + - "README.md" jobs: label: runs-on: ubuntu-latest @@ -20,4 +20,4 @@ jobs: count: 1 labels: | pr: non-breaking - pr: breaking change
\ No newline at end of file + pr: breaking change diff --git a/.github/workflows/falcor-compiler-perf-test.yml b/.github/workflows/falcor-compiler-perf-test.yml index d329642d9..8de8035fa 100644 --- a/.github/workflows/falcor-compiler-perf-test.yml +++ b/.github/workflows/falcor-compiler-perf-test.yml @@ -4,19 +4,19 @@ name: Falcor Compiler Perf-Test on: push: - branches: [ master ] + branches: [master] paths-ignore: - - 'docs/**' - - 'LICENCE' - - 'CONTRIBUTION.md' - - 'README.md' + - "docs/**" + - "LICENCE" + - "CONTRIBUTION.md" + - "README.md" pull_request: - branches: [ master ] + branches: [master] paths-ignore: - - 'docs/**' - - 'LICENCE' - - 'CONTRIBUTION.md' - - 'README.md' + - "docs/**" + - "LICENCE" + - "CONTRIBUTION.md" + - "README.md" concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true @@ -42,61 +42,61 @@ jobs: run: shell: bash steps: - - uses: actions/checkout@v3 - with: - submodules: 'recursive' - fetch-depth: '0' + - uses: actions/checkout@v3 + with: + submodules: "recursive" + fetch-depth: "0" - - name: Setup - uses: ./.github/actions/common-setup - with: - os: ${{matrix.os}} - compiler: ${{matrix.compiler}} - platform: ${{matrix.platform}} - config: ${{matrix.config}} - build-llvm: true + - name: Setup + uses: ./.github/actions/common-setup + with: + os: ${{matrix.os}} + compiler: ${{matrix.compiler}} + platform: ${{matrix.platform}} + config: ${{matrix.config}} + build-llvm: true - - name: Build Slang - run: | - cmake --preset default --fresh \ - -DSLANG_SLANG_LLVM_FLAVOR=USE_SYSTEM_LLVM \ - -DCMAKE_COMPILE_WARNING_AS_ERROR=${{matrix.warnings-as-errors}} \ - -DSLANG_ENABLE_CUDA=1 - cmake --workflow --preset "${{matrix.config}}" + - name: Build Slang + run: | + cmake --preset default --fresh \ + -DSLANG_SLANG_LLVM_FLAVOR=USE_SYSTEM_LLVM \ + -DCMAKE_COMPILE_WARNING_AS_ERROR=${{matrix.warnings-as-errors}} \ + -DSLANG_ENABLE_CUDA=1 + cmake --workflow --preset "${{matrix.config}}" - - uses: robinraju/release-downloader@v1.9 - id: download - with: - # The source repository path. - # Expected format {owner}/{repo} - # Default: ${{ github.repository }} - repository: "shader-slang/falcor-compile-perf-test" + - uses: robinraju/release-downloader@v1.9 + id: download + with: + # The source repository path. + # Expected format {owner}/{repo} + # Default: ${{ github.repository }} + repository: "shader-slang/falcor-compile-perf-test" - # A flag to set the download target as latest release - # The default value is 'false' - latest: true + # A flag to set the download target as latest release + # The default value is 'false' + latest: true - # The name of the file to download. - # Use this field only to specify filenames other than tarball or zipball, if any. - # Supports wildcard pattern (eg: '*', '*.deb', '*.zip' etc..) - fileName: "falcor_perf_test-*-win-64.zip" + # The name of the file to download. + # Use this field only to specify filenames other than tarball or zipball, if any. + # Supports wildcard pattern (eg: '*', '*.deb', '*.zip' etc..) + fileName: "falcor_perf_test-*-win-64.zip" - # Download the attached zipball (*.zip) - zipBall: true + # Download the attached zipball (*.zip) + zipBall: true - # Relative path under $GITHUB_WORKSPACE to place the downloaded file(s) - # It will create the target directory automatically if not present - # eg: out-file-path: "my-downloads" => It will create directory $GITHUB_WORKSPACE/my-downloads - out-file-path: "./falcor-perf-test" + # Relative path under $GITHUB_WORKSPACE to place the downloaded file(s) + # It will create the target directory automatically if not present + # eg: out-file-path: "my-downloads" => It will create directory $GITHUB_WORKSPACE/my-downloads + out-file-path: "./falcor-perf-test" - # Somehow there is a bug in this flag, the executable extracted is not runnable. We have to - # extract ourselves. - extract: false + # Somehow there is a bug in this flag, the executable extracted is not runnable. We have to + # extract ourselves. + extract: false - - name: run falcor-compiler-perf-test - shell: pwsh - run: | - $filename = '${{ fromJson(steps.download.outputs.downloaded_files)[0] }}' - Expand-Archive $filename -DestinationPath .\falcor-perf-test - $env:PATH += ";.\build\${{matrix.config}}\bin"; - .\falcor-perf-test\bin\Release\falcor_perftest.exe + - name: run falcor-compiler-perf-test + shell: pwsh + run: | + $filename = '${{ fromJson(steps.download.outputs.downloaded_files)[0] }}' + Expand-Archive $filename -DestinationPath .\falcor-perf-test + $env:PATH += ";.\build\${{matrix.config}}\bin"; + .\falcor-perf-test\bin\Release\falcor_perftest.exe diff --git a/.github/workflows/falcor-test.yml b/.github/workflows/falcor-test.yml index bb5faeddc..d4fa4f962 100644 --- a/.github/workflows/falcor-test.yml +++ b/.github/workflows/falcor-test.yml @@ -2,19 +2,19 @@ name: Falcor Tests on: push: - branches: [ master ] + branches: [master] paths-ignore: - - 'docs/**' - - 'LICENCE' - - 'CONTRIBUTION.md' - - 'README.md' + - "docs/**" + - "LICENCE" + - "CONTRIBUTION.md" + - "README.md" pull_request: - branches: [ master ] + branches: [master] paths-ignore: - - 'docs/**' - - 'LICENCE' - - 'CONTRIBUTION.md' - - 'README.md' + - "docs/**" + - "LICENCE" + - "CONTRIBUTION.md" + - "README.md" concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true @@ -40,54 +40,54 @@ jobs: run: shell: bash steps: - - uses: actions/checkout@v3 - with: - submodules: 'recursive' - fetch-depth: '0' - - name: Setup - uses: ./.github/actions/common-setup - with: - os: ${{matrix.os}} - compiler: ${{matrix.compiler}} - platform: ${{matrix.platform}} - config: ${{matrix.config}} - build-llvm: true - - name: setup-falcor - shell: pwsh - run: | - mkdir FalcorBin - cd FalcorBin - Copy-Item -Path 'C:\Falcor\build\windows-vs2022\bin' -Destination '.\build\windows-vs2022\bin' -Recurse -Exclude ("*.pdb") - Copy-Item -Path 'C:\Falcor\tests' -Destination '.\' -Recurse - Copy-Item -Path 'C:\Falcor\tools' -Destination '.\' -Recurse - Copy-Item -Path 'C:\Falcor\media' -Destination '.\' -Recurse - Copy-Item -Path 'C:\Falcor\media_internal' -Destination '.\' -Recurse - Copy-Item -Path 'C:\Falcor\scripts' -Destination '.\' -Recurse - cd ..\ - - name: Build Slang - run: | - cmake --preset default --fresh \ - -DSLANG_SLANG_LLVM_FLAVOR=USE_SYSTEM_LLVM \ - -DCMAKE_COMPILE_WARNING_AS_ERROR=${{matrix.warnings-as-errors}} \ - -DSLANG_ENABLE_CUDA=1 \ - -DSLANG_ENABLE_EXAMPLES=0 \ - -DSLANG_ENABLE_GFX=0 \ - -DSLANG_ENABLE_TESTS=0 - cmake --workflow --preset "${{matrix.config}}" - - name: Copy Slang to Falcor - run: | - cp --verbose --recursive --target-directory ./FalcorBin/build/windows-vs2022/bin/Release build/Release/bin/* - - name: falcor-unit-test - shell: pwsh - run: | - $ErrorActionPreference = "SilentlyContinue" - cd .\FalcorBin\tests - python ./testing/run_unit_tests.py --config windows-vs2022-Release -t "-slow" - cd ../../ - - name: falcor-image-test - shell: pwsh - run: | - $ErrorActionPreference = "SilentlyContinue" - cd .\FalcorBin\tests - python ./testing/run_image_tests.py --config windows-vs2022-Release --run-only - cd ../../ + - uses: actions/checkout@v3 + with: + submodules: "recursive" + fetch-depth: "0" + - name: Setup + uses: ./.github/actions/common-setup + with: + os: ${{matrix.os}} + compiler: ${{matrix.compiler}} + platform: ${{matrix.platform}} + config: ${{matrix.config}} + build-llvm: true + - name: setup-falcor + shell: pwsh + run: | + mkdir FalcorBin + cd FalcorBin + Copy-Item -Path 'C:\Falcor\build\windows-vs2022\bin' -Destination '.\build\windows-vs2022\bin' -Recurse -Exclude ("*.pdb") + Copy-Item -Path 'C:\Falcor\tests' -Destination '.\' -Recurse + Copy-Item -Path 'C:\Falcor\tools' -Destination '.\' -Recurse + Copy-Item -Path 'C:\Falcor\media' -Destination '.\' -Recurse + Copy-Item -Path 'C:\Falcor\media_internal' -Destination '.\' -Recurse + Copy-Item -Path 'C:\Falcor\scripts' -Destination '.\' -Recurse + cd ..\ + - name: Build Slang + run: | + cmake --preset default --fresh \ + -DSLANG_SLANG_LLVM_FLAVOR=USE_SYSTEM_LLVM \ + -DCMAKE_COMPILE_WARNING_AS_ERROR=${{matrix.warnings-as-errors}} \ + -DSLANG_ENABLE_CUDA=1 \ + -DSLANG_ENABLE_EXAMPLES=0 \ + -DSLANG_ENABLE_GFX=0 \ + -DSLANG_ENABLE_TESTS=0 + cmake --workflow --preset "${{matrix.config}}" + - name: Copy Slang to Falcor + run: | + cp --verbose --recursive --target-directory ./FalcorBin/build/windows-vs2022/bin/Release build/Release/bin/* + - name: falcor-unit-test + shell: pwsh + run: | + $ErrorActionPreference = "SilentlyContinue" + cd .\FalcorBin\tests + python ./testing/run_unit_tests.py --config windows-vs2022-Release -t "-slow" + cd ../../ + - name: falcor-image-test + shell: pwsh + run: | + $ErrorActionPreference = "SilentlyContinue" + cd .\FalcorBin\tests + python ./testing/run_image_tests.py --config windows-vs2022-Release --run-only + cd ../../ diff --git a/.github/workflows/push-benchmark-results.yml b/.github/workflows/push-benchmark-results.yml index 6eab76816..b2c835768 100644 --- a/.github/workflows/push-benchmark-results.yml +++ b/.github/workflows/push-benchmark-results.yml @@ -4,10 +4,10 @@ on: push: branches: [master] paths-ignore: - - 'docs/**' - - 'LICENCE' - - 'CONTRIBUTION.md' - - 'README.md' + - "docs/**" + - "LICENCE" + - "CONTRIBUTION.md" + - "README.md" concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true @@ -18,8 +18,8 @@ jobs: steps: - uses: actions/checkout@v3 with: - submodules: 'true' - fetch-depth: '0' + submodules: "true" + fetch-depth: "0" - name: Common setup uses: ./.github/actions/common-setup with: @@ -34,8 +34,8 @@ jobs: cmake --workflow --preset release - uses: actions/checkout@v3 with: - repository: 'shader-slang/MDL-SDK' - path: 'external/MDL-SDK' + repository: "shader-slang/MDL-SDK" + path: "external/MDL-SDK" - name: Run benchmark run: | cd tools/benchmark @@ -44,8 +44,8 @@ jobs: python compile.py --samples 16 --target dxil - uses: actions/checkout@v3 with: - repository: 'shader-slang/slang-material-modules-benchmark' - path: 'external/slang-material-modules-benchmark' + repository: "shader-slang/slang-material-modules-benchmark" + path: "external/slang-material-modules-benchmark" token: ${{ secrets.SLANG_MDL_BENCHMARK_RESULTS_PAT }} - name: Push results run: | diff --git a/.github/workflows/release-linux-glibc-2-17.yml b/.github/workflows/release-linux-glibc-2-17.yml index e3f47d9a9..7341e1d92 100644 --- a/.github/workflows/release-linux-glibc-2-17.yml +++ b/.github/workflows/release-linux-glibc-2-17.yml @@ -1,7 +1,7 @@ on: push: tags: - - 'v*' + - "v*" name: centos7-gcc9 Release jobs: @@ -10,8 +10,8 @@ jobs: steps: - uses: actions/checkout@v3 with: - submodules: 'recursive' - fetch-depth: '0' + submodules: "recursive" + fetch-depth: "0" # build the binary in docker image - name: Run the build process with Docker diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0f2375f44..60e4de06f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,12 +7,12 @@ on: branches: - master paths-ignore: - - 'docs/**' - - 'LICENCE' - - 'CONTRIBUTION.md' - - 'README.md' + - "docs/**" + - "LICENCE" + - "CONTRIBUTION.md" + - "README.md" tags: - - 'v*' + - "v*" jobs: release: @@ -23,14 +23,14 @@ jobs: platform: [x86_64, aarch64] test-category: [smoke] include: - - {os: linux, runs-on: ubuntu-20.04, compiler: gcc} - - {os: windows, runs-on: windows-latest, compiler: cl} - - {os: macos, runs-on: macos-latest, compiler: clang} - - - {build-slang-llvm: false} - - {os: linux, platform: x86_64, build-slang-llvm: true} - - {os: windows, platform: x86_64, build-slang-llvm: true} - - {os: macos, platform: aarch64, build-slang-llvm: true} + - { os: linux, runs-on: ubuntu-20.04, compiler: gcc } + - { os: windows, runs-on: windows-latest, compiler: cl } + - { os: macos, runs-on: macos-latest, compiler: clang } + + - { build-slang-llvm: false } + - { os: linux, platform: x86_64, build-slang-llvm: true } + - { os: windows, platform: x86_64, build-slang-llvm: true } + - { os: macos, platform: aarch64, build-slang-llvm: true } fail-fast: false runs-on: ${{ matrix.runs-on }} container: ${{ matrix.image || '' }} @@ -42,8 +42,8 @@ jobs: steps: - uses: actions/checkout@v3 with: - submodules: 'recursive' - fetch-depth: '0' + submodules: "recursive" + fetch-depth: "0" - name: Setup uses: ./.github/actions/common-setup with: @@ -211,4 +211,3 @@ jobs: & ".\build_reference.ps1" env: GITHUB_TOKEN: ${{ secrets.UPDATE_STDLIB_REFERENCE_PAT }} - diff --git a/.github/workflows/slash-command-dispatch.yml b/.github/workflows/slash-command-dispatch.yml index 2e72c3bf4..dc66f19af 100644 --- a/.github/workflows/slash-command-dispatch.yml +++ b/.github/workflows/slash-command-dispatch.yml @@ -13,7 +13,7 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} reaction-token: ${{ secrets.SLANGBOT_PAT }} issue-type: pull-request - commands: | + commands: | format - name: Edit comment with error message diff --git a/.github/workflows/vk-gl-cts-nightly.yml b/.github/workflows/vk-gl-cts-nightly.yml index 3697e17ab..d775dcab6 100644 --- a/.github/workflows/vk-gl-cts-nightly.yml +++ b/.github/workflows/vk-gl-cts-nightly.yml @@ -2,7 +2,7 @@ name: VK-GL-CTS Nightly on: schedule: - - cron: '00 07 * * *' + - cron: "00 07 * * *" concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true @@ -30,83 +30,83 @@ jobs: run: shell: bash steps: - - uses: actions/checkout@v4 - with: - submodules: 'true' - fetch-depth: '0' - - name: Setup - uses: ./.github/actions/common-setup - with: - os: ${{matrix.os}} - compiler: ${{matrix.compiler}} - platform: ${{matrix.platform}} - config: ${{matrix.config}} - build-llvm: true - - name: Build Slang - run: | - cmake --preset default --fresh \ - -DSLANG_SLANG_LLVM_FLAVOR=USE_SYSTEM_LLVM \ - -DCMAKE_COMPILE_WARNING_AS_ERROR=${{matrix.warnings-as-errors}} \ - -DSLANG_ENABLE_CUDA=1 \ - -DSLANG_ENABLE_EXAMPLES=0 \ - -DSLANG_ENABLE_GFX=1 \ - -DSLANG_ENABLE_TESTS=1 - cmake --workflow --preset "${{matrix.config}}" - - uses: robinraju/release-downloader@v1.7 - with: - latest: true - repository: "shader-slang/VK-GL-CTS" - fileName: "VK-GL-CTS_WithSlang-0.0.3-win64.zip" - - uses: actions/checkout@v4 - with: - repository: "shader-slang/VK-GL-CTS" - sparse-checkout: | - test-lists/slang-passing-tests.txt - test-lists/slang-waiver-tests.xml - path: test-lists - sparse-checkout-cone-mode: false - - name: vkcts setup - shell: pwsh - run: | - Expand-Archive VK-GL-CTS_WithSlang-0.0.3-win64.zip - - copy ${{ github.workspace }}\build\Release\bin\slang.dll ${{ github.workspace }}\VK-GL-CTS_WithSlang-0.0.3-win64\VK-GL-CTS_WithSlang-0.0.3-win64\slang.dll - copy ${{ github.workspace }}\build\Release\bin\slang-glslang.dll ${{ github.workspace }}\VK-GL-CTS_WithSlang-0.0.3-win64\VK-GL-CTS_WithSlang-0.0.3-win64\slang-glslang.dll - copy ${{ github.workspace }}\build\Release\bin\test-server.exe ${{ github.workspace }}\VK-GL-CTS_WithSlang-0.0.3-win64\VK-GL-CTS_WithSlang-0.0.3-win64\test-server.exe + - uses: actions/checkout@v4 + with: + submodules: "true" + fetch-depth: "0" + - name: Setup + uses: ./.github/actions/common-setup + with: + os: ${{matrix.os}} + compiler: ${{matrix.compiler}} + platform: ${{matrix.platform}} + config: ${{matrix.config}} + build-llvm: true + - name: Build Slang + run: | + cmake --preset default --fresh \ + -DSLANG_SLANG_LLVM_FLAVOR=USE_SYSTEM_LLVM \ + -DCMAKE_COMPILE_WARNING_AS_ERROR=${{matrix.warnings-as-errors}} \ + -DSLANG_ENABLE_CUDA=1 \ + -DSLANG_ENABLE_EXAMPLES=0 \ + -DSLANG_ENABLE_GFX=1 \ + -DSLANG_ENABLE_TESTS=1 + cmake --workflow --preset "${{matrix.config}}" + - uses: robinraju/release-downloader@v1.7 + with: + latest: true + repository: "shader-slang/VK-GL-CTS" + fileName: "VK-GL-CTS_WithSlang-0.0.3-win64.zip" + - uses: actions/checkout@v4 + with: + repository: "shader-slang/VK-GL-CTS" + sparse-checkout: | + test-lists/slang-passing-tests.txt + test-lists/slang-waiver-tests.xml + path: test-lists + sparse-checkout-cone-mode: false + - name: vkcts setup + shell: pwsh + run: | + Expand-Archive VK-GL-CTS_WithSlang-0.0.3-win64.zip - copy ${{ github.workspace }}\test-lists\test-lists\slang-passing-tests.txt ${{ github.workspace }}\VK-GL-CTS_WithSlang-0.0.3-win64\VK-GL-CTS_WithSlang-0.0.3-win64\slang-passing-tests.txt - copy ${{ github.workspace }}\test-lists\test-lists\slang-waiver-tests.xml ${{ github.workspace }}\VK-GL-CTS_WithSlang-0.0.3-win64\VK-GL-CTS_WithSlang-0.0.3-win64\slang-waiver-tests.xml + copy ${{ github.workspace }}\build\Release\bin\slang.dll ${{ github.workspace }}\VK-GL-CTS_WithSlang-0.0.3-win64\VK-GL-CTS_WithSlang-0.0.3-win64\slang.dll + copy ${{ github.workspace }}\build\Release\bin\slang-glslang.dll ${{ github.workspace }}\VK-GL-CTS_WithSlang-0.0.3-win64\VK-GL-CTS_WithSlang-0.0.3-win64\slang-glslang.dll + copy ${{ github.workspace }}\build\Release\bin\test-server.exe ${{ github.workspace }}\VK-GL-CTS_WithSlang-0.0.3-win64\VK-GL-CTS_WithSlang-0.0.3-win64\test-server.exe - - name: vkcts run - shell: pwsh - working-directory: ${{ github.workspace }}\VK-GL-CTS_WithSlang-0.0.3-win64\VK-GL-CTS_WithSlang-0.0.3-win64 - run: | - .\deqp-vk.exe --deqp-archive-dir=${{ github.workspace }}\VK-GL-CTS_WithSlang-0.0.3-win64\VK-GL-CTS_WithSlang-0.0.3-win64 --deqp-caselist-file=${{ github.workspace }}\VK-GL-CTS_WithSlang-0.0.3-win64\VK-GL-CTS_WithSlang-0.0.3-win64\slang-passing-tests.txt --deqp-waiver-file=${{ github.workspace }}\VK-GL-CTS_WithSlang-0.0.3-win64\VK-GL-CTS_WithSlang-0.0.3-win64\slang-waiver-tests.xml + copy ${{ github.workspace }}\test-lists\test-lists\slang-passing-tests.txt ${{ github.workspace }}\VK-GL-CTS_WithSlang-0.0.3-win64\VK-GL-CTS_WithSlang-0.0.3-win64\slang-passing-tests.txt + copy ${{ github.workspace }}\test-lists\test-lists\slang-waiver-tests.xml ${{ github.workspace }}\VK-GL-CTS_WithSlang-0.0.3-win64\VK-GL-CTS_WithSlang-0.0.3-win64\slang-waiver-tests.xml - - name: Dump TestResults.qpa if failed - shell: pwsh - if: ${{ !success() }} - working-directory: ${{ github.workspace }}\VK-GL-CTS_WithSlang-0.0.3-win64\VK-GL-CTS_WithSlang-0.0.3-win64 - run: Get-Content TestResults.qpa -Tail 1000 - - name: success notification - id: slack-notify-success - if: ${{ success() }} - uses: slackapi/slack-github-action@v1.26.0 - with: - payload: | - { - "CTS-Nightly": ":green-check-mark: CTS nightly status: ${{ job.status }}" - } - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - - name: failure notification - id: slack-notify-failure - if : ${{ !success() }} - uses: slackapi/slack-github-action@v1.26.0 - with: - payload: | - { - "CTS-Nightly": ":alert: :alert: :alert: :alert: :alert: :alert:\nCTS nightly status: ${{ job.status }}: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" - } - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + - name: vkcts run + shell: pwsh + working-directory: ${{ github.workspace }}\VK-GL-CTS_WithSlang-0.0.3-win64\VK-GL-CTS_WithSlang-0.0.3-win64 + run: | + .\deqp-vk.exe --deqp-archive-dir=${{ github.workspace }}\VK-GL-CTS_WithSlang-0.0.3-win64\VK-GL-CTS_WithSlang-0.0.3-win64 --deqp-caselist-file=${{ github.workspace }}\VK-GL-CTS_WithSlang-0.0.3-win64\VK-GL-CTS_WithSlang-0.0.3-win64\slang-passing-tests.txt --deqp-waiver-file=${{ github.workspace }}\VK-GL-CTS_WithSlang-0.0.3-win64\VK-GL-CTS_WithSlang-0.0.3-win64\slang-waiver-tests.xml + + - name: Dump TestResults.qpa if failed + shell: pwsh + if: ${{ !success() }} + working-directory: ${{ github.workspace }}\VK-GL-CTS_WithSlang-0.0.3-win64\VK-GL-CTS_WithSlang-0.0.3-win64 + run: Get-Content TestResults.qpa -Tail 1000 + - name: success notification + id: slack-notify-success + if: ${{ success() }} + uses: slackapi/slack-github-action@v1.26.0 + with: + payload: | + { + "CTS-Nightly": ":green-check-mark: CTS nightly status: ${{ job.status }}" + } + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + - name: failure notification + id: slack-notify-failure + if: ${{ !success() }} + uses: slackapi/slack-github-action@v1.26.0 + with: + payload: | + { + "CTS-Nightly": ":alert: :alert: :alert: :alert: :alert: :alert:\nCTS nightly status: ${{ job.status }}: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" + } + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} diff --git a/CMakePresets.json b/CMakePresets.json index 0e53295e7..ec4f6a988 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -96,25 +96,19 @@ "name": "emscripten", "configurePreset": "emscripten", "configuration": "Release", - "targets": [ - "slang-wasm" - ] + "targets": ["slang-wasm"] }, { "name": "generators", "inherits": "release", "configurePreset": "generators", - "targets": [ - "all-generators" - ] + "targets": ["all-generators"] }, { "name": "slang-llvm", "inherits": "release", "configurePreset": "slang-llvm", - "targets": [ - "slang-llvm" - ] + "targets": ["slang-llvm"] } ], "packagePresets": [ @@ -122,9 +116,7 @@ "name": "base", "hidden": true, "configurePreset": "default", - "generators": [ - "ZIP" - ], + "generators": ["ZIP"], "variables": { "CPACK_PACKAGE_FILE_NAME": "slang", "CPACK_COMPONENTS_ALL": "Unspecified;metadata;slang-llvm" @@ -133,9 +125,7 @@ { "name": "release", "inherits": "base", - "configurations": [ - "Release" - ], + "configurations": ["Release"], "packageDirectory": "dist-release" }, { @@ -149,9 +139,7 @@ { "name": "debug", "inherits": "base", - "configurations": [ - "Debug" - ], + "configurations": ["Debug"], "packageDirectory": "dist-debug" }, { diff --git a/docs/scripts/release-note.sh b/docs/scripts/release-note.sh index 250873bb0..d63ee8736 100644 --- a/docs/scripts/release-note.sh +++ b/docs/scripts/release-note.sh @@ -16,27 +16,23 @@ verbose=true $verbose && echo "Reminder: PLEASE make sure your local repo is up-to-date before running the script." >&2 gh="" -for candidate in "$(which gh.exe)" "/mnt/c/Program Files/GitHub CLI/gh.exe" "/c/Program Files/GitHub CLI/gh.exe" "/cygdrive/c/Program Files/GitHub CLI/gh.exe" -do - if [ -x "$candidate" ] - then - gh="$candidate" - break - fi +for candidate in "$(which gh.exe)" "/mnt/c/Program Files/GitHub CLI/gh.exe" "/c/Program Files/GitHub CLI/gh.exe" "/cygdrive/c/Program Files/GitHub CLI/gh.exe"; do + if [ -x "$candidate" ]; then + gh="$candidate" + break + fi done -if [ "x$gh" = "x" ] || ! [ -x "$gh" ] -then - echo "File not found: gh.exe" - echo "gh.exe can be downloaded from https://cli.github.com" - exit 1 +if [ "x$gh" = "x" ] || ! [ -x "$gh" ]; then + echo "File not found: gh.exe" + echo "gh.exe can be downloaded from https://cli.github.com" + exit 1 fi $verbose && echo "gh.exe is found from: $gh" >&2 -if [ "x$1" = "x" ] -then - echo "This script requires 'since' information for git-log command." - echo "Usage: $0 2024-07-30" - exit 1 +if [ "x$1" = "x" ]; then + echo "This script requires 'since' information for git-log command." + echo "Usage: $0 2024-07-30" + exit 1 fi since="$1" @@ -45,62 +41,55 @@ commitsCount="$(echo "$commits" | wc -l)" echo "=== Breaking changes ===" breakingChanges="" -for i in $(seq $commitsCount) -do - line="$(echo "$commits" | head -$i | tail -1)" - - # Get PR number from the git commit title - pr="$(echo "$line" | grep '#[1-9][0-9][0-9][0-9][0-9]*' | sed 's|.* (\#\([1-9][0-9][0-9][0-9][0-9]*\))|\1|')" - [ "x$pr" = "x" ] && continue - - # Check if the PR is marked as a breaking change - if "$gh" issue view $pr --json labels | grep -q 'pr: breaking change' - then - breakingChanges+="$line" - fi +for i in $(seq $commitsCount); do + line="$(echo "$commits" | head -$i | tail -1)" + + # Get PR number from the git commit title + pr="$(echo "$line" | grep '#[1-9][0-9][0-9][0-9][0-9]*' | sed 's|.* (\#\([1-9][0-9][0-9][0-9][0-9]*\))|\1|')" + [ "x$pr" = "x" ] && continue + + # Check if the PR is marked as a breaking change + if "$gh" issue view $pr --json labels | grep -q 'pr: breaking change'; then + breakingChanges+="$line" + fi done -if [ "x$breakingChanges" = "x" ] -then - echo "No breaking changes" +if [ "x$breakingChanges" = "x" ]; then + echo "No breaking changes" else - echo "$breakingChanges" + echo "$breakingChanges" fi echo "" echo "=== All changes for this release ===" -for i in $(seq $commitsCount) -do - line="$(echo "$commits" | head -$i | tail -1)" - - result="$line" - for dummy in 1 - do - # Get PR number from the git commit title - pr="$(echo "$line" | grep '#[1-9][0-9][0-9][0-9][0-9]*' | sed 's|.* (\#\([1-9][0-9][0-9][0-9][0-9]*\))|\1|')" - [ "x$pr" = "x" ] && break - - # Mark breaking changes with "[BREAKING]" - if "$gh" issue view $pr --json labels | grep -q 'pr: breaking change' - then - result="[BREAKING] $line" - fi - - # Get the issue number for the PR - body="$("$gh" issue view $pr --json body)" - [ "x$body" = "x" ] && break - issue="$(echo "$body" | grep '#[1-9][0-9][0-9][0-9][0-9]*' | sed 's|.*\#\([1-9][0-9][0-9][0-9][0-9]*\).*|\1|')" - [ "x$issue" = "x" ] && break - - # Get the labels of the issue - label="$("$gh" issue view $issue --json labels)" - [ "x$label" = "x" ] && break - - # Get the goal type from the labels - goal="$(echo "$label" | grep '"goal:' | sed 's|.*"goal:\([^"]*\)".*|\1|')" - [ "x$goal" = "x" ] && break - - result+=" (#$issue:$goal)" - done - echo "$result" +for i in $(seq $commitsCount); do + line="$(echo "$commits" | head -$i | tail -1)" + + result="$line" + for dummy in 1; do + # Get PR number from the git commit title + pr="$(echo "$line" | grep '#[1-9][0-9][0-9][0-9][0-9]*' | sed 's|.* (\#\([1-9][0-9][0-9][0-9][0-9]*\))|\1|')" + [ "x$pr" = "x" ] && break + + # Mark breaking changes with "[BREAKING]" + if "$gh" issue view $pr --json labels | grep -q 'pr: breaking change'; then + result="[BREAKING] $line" + fi + + # Get the issue number for the PR + body="$("$gh" issue view $pr --json body)" + [ "x$body" = "x" ] && break + issue="$(echo "$body" | grep '#[1-9][0-9][0-9][0-9][0-9]*' | sed 's|.*\#\([1-9][0-9][0-9][0-9][0-9]*\).*|\1|')" + [ "x$issue" = "x" ] && break + + # Get the labels of the issue + label="$("$gh" issue view $issue --json labels)" + [ "x$label" = "x" ] && break + + # Get the goal type from the labels + goal="$(echo "$label" | grep '"goal:' | sed 's|.*"goal:\([^"]*\)".*|\1|')" + [ "x$goal" = "x" ] && break + + result+=" (#$issue:$goal)" + done + echo "$result" done - diff --git a/external/build-llvm.sh b/external/build-llvm.sh index 95302a742..0575bf4bf 100755 --- a/external/build-llvm.sh +++ b/external/build-llvm.sh @@ -20,7 +20,7 @@ EOF # # Some helper functions # -msg(){ +msg() { printf "%s\n" "$1" >&2 } @@ -62,13 +62,35 @@ extra_arguments=() while [[ "$#" -gt 0 ]]; do case $1 in - -h | --help) help; exit ;; - --repo) repo=$2; shift;; - --branch) branch=$2; shift;; - --source-dir) source_dir=$2; shift;; - --config) config=$2; shift;; - --install-prefix) install_prefix=$2; shift;; - --) shift; extra_arguments+=("$@"); break;; + -h | --help) + help + exit + ;; + --repo) + repo=$2 + shift + ;; + --branch) + branch=$2 + shift + ;; + --source-dir) + source_dir=$2 + shift + ;; + --config) + config=$2 + shift + ;; + --install-prefix) + install_prefix=$2 + shift + ;; + --) + shift + extra_arguments+=("$@") + break + ;; *) msg "Unknown parameter passed: $1" help >&2 diff --git a/external/bump-glslang.sh b/external/bump-glslang.sh index b7d30e3a0..d3923cf0e 100755 --- a/external/bump-glslang.sh +++ b/external/bump-glslang.sh @@ -35,7 +35,7 @@ while [[ "$#" -gt 0 ]]; do shift done -if [ $help ]; then +if [ "$help" ]; then me=$(basename "$0") cat <<EOF $me: Update external/glslang and dependencies @@ -62,27 +62,24 @@ EOF exit fi -big_msg() -{ +big_msg() { echo echo "################################################################" echo "$1" echo "################################################################" } -require_bin() -{ - if ! command -v "$1" &> /dev/null - then - echo "This script needs $1, but it isn't in \$PATH" - missing_bin=1 +require_bin() { + if ! command -v "$1" &>/dev/null; then + echo "This script needs $1, but it isn't in \$PATH" + missing_bin=1 fi } require_bin "jq" require_bin "git" require_bin "python" require_bin "cmake" -if [ $missing_bin ]; then +if [ "$missing_bin" ]; then exit 1 fi @@ -100,13 +97,13 @@ if ! test -f "$glslang/.git"; then exit 1 fi -known_good_commit(){ +known_good_commit() { jq <"$glslang/known_good.json" \ ".commits | .[] | select(.name == \"$1\") | .commit" \ --raw-output } -bump_dep(){ +bump_dep() { commit=$(known_good_commit "$2") big_msg "Fetching $commit from origin in $1" git -C "$1" fetch origin "$commit" @@ -116,7 +113,7 @@ bump_dep(){ declare -A old_ref declare -A new_ref -merge_dep(){ +merge_dep() { name=$1 dir=$2 up=$3 @@ -180,14 +177,15 @@ rm -f "$spirv_tools_generated/*.{inc,h}" cp --target-directory "$spirv_tools_generated" "$build"/*.{inc,h} set +x -if [ $do_commit ]; then +if [ "$do_commit" ]; then big_msg "Committing changes" - msg=$(cat <<EOF + msg=$( + cat <<EOF external/glslang: ${old_ref["glslang"]} -> ${new_ref["glslang"]} external/spirv-tools: ${old_ref["spirv-tools"]} -> ${new_ref["spirv-tools"]}" EOF -) + ) git commit \ --message "$msg" \ diff --git a/extras/formatting.sh b/extras/formatting.sh index 664eb68b9..88bf219ff 100755 --- a/extras/formatting.sh +++ b/extras/formatting.sh @@ -74,6 +74,8 @@ require_bin "gersemi" "0.17" require_bin "xargs" "3" require_bin "diff" "2" require_bin "clang-format" "17" "18" +require_bin "prettier" "3" +require_bin "shfmt" "3" if [ "$missing_bin" ]; then exit 1 @@ -82,6 +84,8 @@ fi exit_code=0 cmake_formatting() { + echo "Formatting CMake files..." + readarray -t files < <(git ls-files '*.cmake' 'CMakeLists.txt' '**/CMakeLists.txt') common_args=( @@ -99,7 +103,9 @@ cmake_formatting() { } cpp_formatting() { - readarray -t files < <(git ls-files '*.cpp' '*.hpp' '*.c' '*.h') + echo "Formatting cpp files..." + + readarray -t files < <(git ls-files '*.cpp' '*.hpp' '*.c' '*.h' ':!external/**') if [ "$check_only" -eq 1 ]; then local tmpdir @@ -123,7 +129,38 @@ cpp_formatting() { fi } +yaml_json_formatting() { + echo "Formatting yaml and json files..." + + readarray -t files < <(git ls-files "*.yaml" "*.yml" "*.json" ':!external/**') + + if [ "$check_only" -eq 1 ]; then + prettier --check "${files[@]}" || exit_code=1 + else + prettier --write "${files[@]}" | grep -v '(unchanged)' || : + fi +} + +sh_formatting() { + echo "Formatting sh files..." + + readarray -t files < <(git ls-files "*.sh") + + common_args=( + # default 8 is way too wide + --indent 2 + ) + + if [ "$check_only" -eq 1 ]; then + shfmt "${common_args[@]}" --diff "${files[@]}" || exit_code=1 + else + shfmt "${common_args[@]}" --write "${files[@]}" + fi +} + cmake_formatting cpp_formatting +yaml_json_formatting +sh_formatting exit $exit_code diff --git a/extras/macos-notarize.json b/extras/macos-notarize.json index ee369a0ac..517ea30f4 100644 --- a/extras/macos-notarize.json +++ b/extras/macos-notarize.json @@ -1,7 +1,7 @@ { - "notarize" :{ - "path": "slang-macos-dist.zip", - "bundle_id": "shader-slang.slang", - "staple": false - } -}
\ No newline at end of file + "notarize": { + "path": "slang-macos-dist.zip", + "bundle_id": "shader-slang.slang", + "staple": false + } +} diff --git a/extras/macos-sign.json b/extras/macos-sign.json index fbe511bf3..b37429498 100644 --- a/extras/macos-sign.json +++ b/extras/macos-sign.json @@ -1,11 +1,11 @@ { - "source" : [ - "./bin/macosx-*/release/libslang.dylib", - "./bin/macosx-*/release/slangc", - "./bin/macosx-*/release/slangd" - ], - "bundle_id" : "shader-slang.slang", - "sign" :{ - "application_identity" : "d6ada82a113e4204aaad914e1013e9548ffd30d0" - } -}
\ No newline at end of file + "source": [ + "./bin/macosx-*/release/libslang.dylib", + "./bin/macosx-*/release/slangc", + "./bin/macosx-*/release/slangd" + ], + "bundle_id": "shader-slang.slang", + "sign": { + "application_identity": "d6ada82a113e4204aaad914e1013e9548ffd30d0" + } +} |
