summaryrefslogtreecommitdiffstats
path: root/.github/workflows/push-benchmark-results.yml
blob: ba080838140eab1a7b6e736f420f11e699e53627 (plain)
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
57
58
59
60
61
62
name: Push MDL Benchmark Results

on:
  push:
    branches: [master]
    paths-ignore:
      - 'docs/**'
      - 'LICENCE'
      - 'CONTRIBUTION.md'
      - 'README.md'
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  build:
    runs-on: [Windows, self-hosted]
    steps:
      - uses: actions/checkout@v3
        with:
          submodules: 'true'
          fetch-depth: '0'
      - name: Common setup
        uses: ./.github/actions/common-setup
        with:
          os: windows
          compiler: cl
          platform: x86_64
          config: release
          build-llvm: true
      - name: Build Slang
        run: |
          cmake --preset default --fresh -DSLANG_SLANG_LLVM_FLAVOR=USE_SYSTEM_LLVM -DCMAKE_COMPILE_WARNING_AS_ERROR=false
          cmake --workflow --preset release
      - uses: actions/checkout@v3
        with:
          repository: 'shader-slang/MDL-SDK'
          path: 'external/MDL-SDK'
      - name: Run benchmark
        run: |
          cd tools/benchmark
          cp ../../external/MDL-SDK/examples/mdl_sdk/dxr/content/slangified/*.slang .
          pip install prettytable argparse
          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'
          token: ${{ secrets.SLANG_MDL_BENCHMARK_RESULTS_PAT }}
      - name: Push results
        run: |
          cp tools/benchmark/benchmarks.json external\slang-material-modules-benchmark
          echo $(Invoke-Expression "git log -1 --pretty=%s") > external\slang-material-modules-benchmark\commit
          echo $(Invoke-Expression "git log -1 --pretty=%H") > external\slang-material-modules-benchmark\commit-hash
          echo $(Invoke-Expression "git log -1 --pretty=%s") > external\slang-material-modules-benchmark\current
          echo $(Invoke-Expression "git log -1 --pretty=%H") >> external\slang-material-modules-benchmark\current
          cd external\slang-material-modules-benchmark
          ls
          git add benchmarks.json current
          git commit -m "$(cat commit)" -m "https://github.com/shader-slang/slang/commit/$(cat commit-hash)"
          git log
          git push