aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/.github/actions/build-foo
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2021-07-02 20:16:57 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2021-07-02 20:22:14 +0300
commit3d49180b0bfb13b80694936f6dd6c25aa4355676 (patch)
tree9a1c3fe8a47bc6cff712989928c3ce35c4d40a0a /.github/actions/build-foo
parentapt-get best scripting practices (diff)
downloadsetup-clang-3d49180b0bfb13b80694936f6dd6c25aa4355676.tar.gz
setup-clang-3d49180b0bfb13b80694936f6dd6c25aa4355676.zip
workflows/test: factor out steps & refactoring
Diffstat (limited to '')
-rw-r--r--.github/actions/build-foo-cygwin/action.yml20
-rw-r--r--.github/actions/build-foo/action.yml20
2 files changed, 40 insertions, 0 deletions
diff --git a/.github/actions/build-foo-cygwin/action.yml b/.github/actions/build-foo-cygwin/action.yml
new file mode 100644
index 0000000..08fb820
--- /dev/null
+++ b/.github/actions/build-foo-cygwin/action.yml
@@ -0,0 +1,20 @@
+name: Build foo.exe
+description: Build foo.exe (on Cygwin)
+inputs:
+ platform:
+ description: Target platform
+ required: true
+runs:
+ using: composite
+ steps:
+ - run: |
+ IFS= read -r src_dir <<'EOF'
+ ${{ github.workspace }}
+ EOF
+ echo "$src_dir"
+ src_dir="$( cygpath -ua "$src_dir" )"
+ cd -- "$src_dir"
+ arch=
+ [ '${{ matrix.platform }}' == 'x86' ] && arch=-m32
+ clang++ $arch -std=c++14 -o foo.exe foo.cpp
+ shell: C:\tools\cygwin\bin\bash.exe --login --norc -eo pipefail -o igncr '{0}'
diff --git a/.github/actions/build-foo/action.yml b/.github/actions/build-foo/action.yml
new file mode 100644
index 0000000..50f3f1e
--- /dev/null
+++ b/.github/actions/build-foo/action.yml
@@ -0,0 +1,20 @@
+name: Build foo.exe
+description: Build foo.exe
+inputs:
+ platform:
+ description: Target platform
+ required: true
+runs:
+ using: composite
+ steps:
+ - run: |
+ $flags = @()
+ if ('${{ matrix.platform }}' -eq 'x86') {
+ $flags += '-m32'
+ }
+ $flags += '-std=c++14','-o','foo.exe','foo.cpp'
+ if ('${{ runner.os }}' -eq 'Linux') {
+ $flags += '-lpthread'
+ }
+ clang++ $flags
+ shell: pwsh