aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2021-01-02 13:25:10 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2021-01-02 13:25:10 +0300
commit691a2dc3b1bc616cc0359fb11bdde1991e9dc4a4 (patch)
tree8186735fed366c026f7fc3a6979f1bafc5a3ebd5
parentsetup cc/c++ executables (diff)
downloadsetup-clang-691a2dc3b1bc616cc0359fb11bdde1991e9dc4a4.tar.gz
setup-clang-691a2dc3b1bc616cc0359fb11bdde1991e9dc4a4.zip
code style
-rw-r--r--.github/workflows/test.yml8
-rw-r--r--action.yml5
2 files changed, 8 insertions, 5 deletions
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index b367d81..7348cbe 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -63,11 +63,7 @@ jobs:
if ('${{ matrix.platform }}' -eq 'x86') {
$flags += '-m32'
}
- $flags += @(
- '-std=c++14',
- '-o', 'foo.exe',
- 'foo.cpp'
- )
+ $flags += '-std=c++14','-o','foo.exe','foo.cpp'
if ('${{ runner.os }}' -eq 'Linux') {
$flags += '-lpthread'
}
@@ -80,8 +76,10 @@ jobs:
Doing something #2
Doing something #3
"@
+
$actual = & (Join-Path . foo.exe)
$actual = $actual -join [Environment]::NewLine
+
$($actual -eq $expected) -or $(throw @"
Unexpected output:
$actual
diff --git a/action.yml b/action.yml
index 32aab7e..4fde9a5 100644
--- a/action.yml
+++ b/action.yml
@@ -92,6 +92,7 @@ runs:
[Parameter(Mandatory=$true)]
[string] $Path
)
+
$realpath = realpath.exe --no-symlinks -- $Path
$dirname = dirname.exe -- $realpath
$dirname = cygpath.exe -wa $dirname
@@ -108,11 +109,14 @@ runs:
$link_path = $Path
$link_winpath = Convert-CygwinPath $link_path
$link_ext = [System.IO.Path]::GetExtension($link_path)
+
$dest_path = readlink.exe --canonicalize-existing -- $link_path
$dest_winpath = Convert-CygwinPath $dest_path
$dest_ext = [System.IO.Path]::GetExtension($dest_path)
+
echo "Removing symlink: $link_winpath"
Remove-Item $link_winpath -Force
+
if ($dest_ext.ToLower() -ne $link_ext.ToLower()) {
$link_winpath += $dest_ext
}
@@ -139,6 +143,7 @@ runs:
If you _are_ using 32-bit Cygwin, please ignore this message.
'@
}
+
# IDK why, but without libiconv-devel, even a "Hello, world!"
# C++ app cannot be compiled as of December 2020. Also, libstdc++
# is required; it's simpler to install gcc-g++ for all the