aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/.github/actions/run-example/action.yml
blob: 46a6f902d35532a6e4837df091114045443da1a8 (plain) (blame)
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
name: Run example project
description: Run example project
inputs:
  install_dir:
    description: Installation directory
    required: true
runs:
  using: composite
  steps:
    - env:
        ARG_INSTALL_DIR: ${{ inputs.install_dir }}
      run: |
        $install_dir = (Get-ChildItem env:ARG_INSTALL_DIR).Value

        if ((Get-ChildItem env:CI_HOST_LINUX).Value -and !(Get-ChildItem env:CI_TARGET_LINUX).Value) {
            echo 'Not going to do that on Linux + MinGW'
            exit
        }

        if ((Get-ChildItem env:CI_TARGET_LINUX).Value) {
            $lib = Join-Path $install_dir 'lib'
            if (Test-Path $lib) {
                $lib = (Resolve-Path $lib).Path
                $env:LD_LIBRARY_PATH = $lib
            }
        }
        $name = 'foo' + (Get-ChildItem env:CI_EXE_EXT).Value
        $path = Join-Path $install_dir 'bin' $name
        echo "Executable path: $path"
        & $path
      shell: pwsh