actions/build-foo: use versioned clang++ binary

This commit is contained in:
Egor Tensin 2021-07-03 02:26:25 +03:00
parent 05b4d64580
commit c5aa391b68
2 changed files with 10 additions and 1 deletions

View file

@ -1,6 +1,9 @@
name: Build foo.exe name: Build foo.exe
description: Build foo.exe description: Build foo.exe
inputs: inputs:
version:
description: Version to use
required: false
platform: platform:
description: Target platform description: Target platform
required: true required: true
@ -8,6 +11,9 @@ runs:
using: composite using: composite
steps: steps:
- run: | - run: |
$version = '${{ inputs.version }}'
$version = if ($version) { "-$version" } else { $version }
$flags = @() $flags = @()
if ('${{ matrix.platform }}' -eq 'x86') { if ('${{ matrix.platform }}' -eq 'x86') {
$flags += '-m32' $flags += '-m32'
@ -16,5 +22,6 @@ runs:
if ('${{ runner.os }}' -eq 'Linux') { if ('${{ runner.os }}' -eq 'Linux') {
$flags += '-lpthread' $flags += '-lpthread'
} }
clang++ $flags
& "clang++$version" $flags
shell: pwsh shell: pwsh

View file

@ -57,6 +57,8 @@ jobs:
cc: 1 cc: 1
- name: Build foo.exe - name: Build foo.exe
uses: ./.github/actions/build-foo uses: ./.github/actions/build-foo
with:
version: '${{ matrix.version }}'
- name: Run foo.exe - name: Run foo.exe
uses: ./.github/actions/run-foo uses: ./.github/actions/run-foo
- name: Check cc/c++ - name: Check cc/c++