summaryrefslogtreecommitdiffstats
path: root/.github/workflows/falcor-compiler-perf-test.yml
blob: 5852db4a53bb8af74f8ee57287f25590e7e55f79 (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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# This is a basic workflow to help you get started with Actions

name: Falcor Compiler Perf-Test

on:
  pull_request:
    branches: [master]
    paths-ignore:
      - "docs/**"
      - "LICENSES/**"
      - "LICENSE"
      - "CONTRIBUTING.md"
      - "README.md"
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true
jobs:
  build:
    timeout-minutes: 100
    continue-on-error: false
    strategy:
      fail-fast: false
      matrix:
        os: [windows]
        config: [release]
        compiler: [cl]
        platform: [x86_64]
        include:
          # Self-hosted falcor tests
          - warnings-as-errors: true
            test-category: full
            full-gpu-tests: false
            runs-on: [Windows, self-hosted, perf]
    runs-on: ${{ matrix.runs-on }}
    defaults:
      run:
        shell: bash
    steps:
      - uses: actions/checkout@v4
        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}}"

      - uses: robinraju/release-downloader@v1.12
        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

          # 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"

          # 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

      - name: run falcor-compiler-perf-test
        shell: pwsh
        run: |
          $ErrorActionPreference = "Stop"
          $filename = '${{ fromJson(steps.download.outputs.downloaded_files)[0] }}'
          # Check if the downloaded file exists
          if (-not (Test-Path $filename)) {
            Write-Error "Downloaded file not found: $filename"
            exit 1
          }
          Expand-Archive $filename -DestinationPath .\falcor-perf-test
          $env:PATH = ".\build\${{matrix.config}}\bin;" + $env:PATH

          # View current PATH
          Write-Host "PATH is $env:PATH"

          # Run the executable and check exit code
          Write-Host "Running falcor performance test..."
          & .\falcor-perf-test\bin\Release\falcor_perftest.exe
          if ($LASTEXITCODE -ne 0) {
            Write-Error "falcor_perftest.exe failed with exit code: $LASTEXITCODE"
            exit $LASTEXITCODE
          }
          Write-Host "falcor performance test completed successfully"