aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/.github/actions/build-foo/action.yml
blob: 1f246f83ac3d74c3951d954b57436c45f1ffa08f (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
name: Build foo.exe
description: Build foo.exe
inputs:
  version:
    description: Version to use
    required: false
  platform:
    description: Target platform
    required: true
runs:
  using: composite
  steps:
    - run: |
        $version = '${{ inputs.version }}'
        $version = if ($version) { "-$version" } else { $version }

        $flags = @()
        if ('${{ matrix.platform }}' -eq 'x86') {
            $flags += '-m32'
        }
        $flags += '-std=c++11','-o','foo','foo.cpp'
        if ('${{ runner.os }}' -eq 'Linux') {
            $flags += '-lpthread'
        }

        & "g++$version" $flags
      shell: pwsh