From 01d437c0618e76d3c44e7d58f5d175c75cb37bac Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Sun, 5 Sep 2021 21:52:59 +0300 Subject: set up clang/clang++ symlinks --- .github/actions/check-cc-cygwin/action.yml | 4 ++-- .github/actions/check-cc/action.yml | 6 ++++-- .github/workflows/test.yml | 8 ++++---- README.md | 4 ++-- action.yml | 15 ++++++++++++--- 5 files changed, 24 insertions(+), 13 deletions(-) diff --git a/.github/actions/check-cc-cygwin/action.yml b/.github/actions/check-cc-cygwin/action.yml index f536649..432d1b8 100644 --- a/.github/actions/check-cc-cygwin/action.yml +++ b/.github/actions/check-cc-cygwin/action.yml @@ -1,5 +1,5 @@ -name: Check cc/c++ -description: Check cc/c++ (on Cygwin) +name: Check symlinks +description: Check symlinks (on Cygwin) runs: using: composite steps: diff --git a/.github/actions/check-cc/action.yml b/.github/actions/check-cc/action.yml index 1e5b988..aef6d9c 100644 --- a/.github/actions/check-cc/action.yml +++ b/.github/actions/check-cc/action.yml @@ -1,5 +1,5 @@ -name: Check cc/c++ -description: Check cc/c++ +name: Check symlinks +description: Check symlinks inputs: version: description: Specific version to check @@ -28,5 +28,7 @@ runs: } Check-Exe cc + Check-Exe clang Check-Exe c++ + Check-Exe clang++ shell: pwsh diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6ead135..4cde415 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,7 +31,7 @@ jobs: uses: ./.github/actions/build-foo - name: Run foo.exe uses: ./.github/actions/run-foo - - name: Check cc/c++ + - name: Check symlinks uses: ./.github/actions/check-cc versions: @@ -63,7 +63,7 @@ jobs: binary: '${{ steps.setup.outputs.clangxx }}' - name: Run foo.exe uses: ./.github/actions/run-foo - - name: Check cc/c++ + - name: Check symlinks uses: ./.github/actions/check-cc with: version: '${{ matrix.version }}' @@ -99,9 +99,9 @@ jobs: if: '!matrix.hardlinks' - name: Run foo.exe uses: ./.github/actions/run-foo - - name: Check cc/c++ + - name: Check symlinks uses: ./.github/actions/check-cc if: matrix.hardlinks - - name: Check cc/c++ on Cygwin + - name: Check symlinks uses: ./.github/actions/check-cc-cygwin if: '!matrix.hardlinks' diff --git a/README.md b/README.md index c1c9135..19910d0 100644 --- a/README.md +++ b/README.md @@ -39,8 +39,8 @@ API | | *any* | | Install the i686 toolchain. | cygwin | *any* | ✓ | Install native binaries. | | 1 | | Install Cygwin packages. -| cc | 1 | ✓ | Set up `cc`/`c++` executables. -| | *any* | | Don't set up `cc`/`c++`. +| cc | 1 | ✓ | Set up `cc`/`clang`/`c++`/`clang++` executables. +| | *any* | | Don't set up the executables. | hardlinks | *any* | ✓ | Cygwin: don't convert any symlinks. | | 1 | | Cygwin: convert symlinks in /usr/bin to hardlinks. diff --git a/action.yml b/action.yml index 0bc9fc3..9ef8f3c 100644 --- a/action.yml +++ b/action.yml @@ -15,7 +15,7 @@ inputs: required: false default: 0 cc: - description: Set up cc/c++ executables + description: Set up cc/clang/c++/clang++ executables required: false default: 1 hardlinks: @@ -211,6 +211,9 @@ runs: New-Variable cc -Value ('${{ inputs.cc }}' -eq '1') -Option Constant + New-Variable clang -Value '${{ steps.install.outputs.clang }}' -Option Constant + New-Variable clangxx -Value '${{ steps.install.outputs.clangxx }}' -Option Constant + function Link-Exe { param( [Parameter(Mandatory=$true)] @@ -234,8 +237,14 @@ runs: } if ($cc) { - Link-Exe '${{ steps.install.outputs.clang }}' cc - Link-Exe '${{ steps.install.outputs.clangxx }}' c++ + Link-Exe $clang cc + if ($clang -ne 'clang') { + Link-Exe $clang 'clang' + } + Link-Exe $clangxx c++ + if ($clangxx -ne 'clang++') { + Link-Exe $clangxx 'clang++' + } } shell: pwsh -- cgit v1.2.3