aboutsummaryrefslogblamecommitdiffstatshomepage
path: root/.github/actions/build-foo/action.yml
blob: 1f246f83ac3d74c3951d954b57436c45f1ffa08f (plain) (tree)
1
2
3
4
5
6

                          

                               





                                

                                                                  


                                                 
                                                   

                                             
                              
                 
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