Browse Source

CI: Avoid inline scripting and use a single matrix. (#1495)

pull/1496/head
josetr 5 years ago committed by GitHub
parent
commit
ce1b3fe985
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 61
      .github/workflows/main.yml
  2. 8
      build/Compile.sh
  3. 23
      build/RunTests.sh
  4. 13
      build/Setup.sh

61
.github/workflows/main.yml

@ -3,67 +3,40 @@ name: CI @@ -3,67 +3,40 @@ name: CI
on: [push, pull_request]
jobs:
posix:
job:
strategy:
fail-fast: false
matrix:
config:
- { os: ubuntu-20.04, cc: gcc-7, cxx: g++-7 }
- { os: macos-10.15, cc: "clang", cxx: "clang++" }
- { os: ubuntu-20.04, platform: x64, cxx: g++-7, cc: gcc-7 }
- { os: macos-10.15, platform: x64, cxx: "clang++", cc: "clang" }
- { os: windows-2019, platform: x86, vs: 2019 }
- { os: windows-2019, platform: x64, vs: 2019 }
runs-on: ${{ matrix.config.os }}
env:
CC: ${{ matrix.config.cc }}
CXX: ${{ matrix.config.cxx }}
steps:
- uses: actions/checkout@v2
- name: Setup
run: |
source build/InstallMono.sh &&
build/InstallNugets.sh &&
build/premake.sh --file=build/scripts/LLVM.lua download_llvm
- name: Build
run: build/Compile.sh
- name: Test
run: build/RunTests.sh
windows:
strategy:
fail-fast: false
matrix:
config:
- { os: windows-2019, vs: 2019, platform: x86 }
- { os: windows-2019, vs: 2019, platform: x64 }
runs-on: ${{ matrix.config.os }}
env:
VS_VERSION: ${{ matrix.config.vs }}
PLATFORM: ${{ matrix.config.platform }}
steps:
- name: Environment
run: |
echo "C:\\Program Files (x86)\\Microsoft Visual Studio\\${{matrix.config.vs}}\\Enterprise\\MSBuild\\Current\\Bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- uses: actions/checkout@v2
- name: Setup
shell: cmd
run: |
build\premake5.exe --file=build\scripts\LLVM.lua download_llvm --arch=%PLATFORM%
- name: Environment
if: ${{ matrix.config.vs > 0 }}
shell: bash
run: echo "/c/Program Files (x86)/Microsoft Visual Studio/$VS_VERSION/Enterprise/MSBuild/Current/Bin" >> $GITHUB_PATH
- name: Setup
shell: bash
run: build/Setup.sh
- name: Build
shell: cmd
run: |
build\premake5.exe --file=build\premake5.lua vs%VS_VERSION% --arch=%PLATFORM%
msbuild build\vs%VS_VERSION%\CppSharp.sln /p:Configuration=Release /verbosity:minimal
shell: bash
run: build/Compile.sh
- name: Test
shell: bash
run: |
build/InstallNugets.sh &&
build/RunTests.sh
run: build/RunTests.sh

8
build/Compile.sh

@ -4,6 +4,14 @@ set -e @@ -4,6 +4,14 @@ set -e
CUR_DIR=$(cd "$(dirname "$0")"; pwd)
DEBUG=false
case $(uname -s) in
CYGWIN*|MINGW32*|MSYS*|MINGW*)
$CUR_DIR/premake5.exe --file=$CUR_DIR/premake5.lua vs$VS_VERSION --arch=$PLATFORM
MSBuild.exe $CUR_DIR/vs$VS_VERSION/CppSharp.sln //p:Configuration=Release //verbosity:minimal
exit 0
;;
esac
for i in "$@"
do
case $i in

23
build/RunTests.sh

@ -1,20 +1,19 @@ @@ -1,20 +1,19 @@
#!/bin/sh
set -e
DIR=$( cd "$( dirname "$0" )" && pwd )
case "$(uname -s)" in
Darwin|Linux)
ACTION=gmake
MONO=mono
export PATH=$PATH:/Library/Frameworks/Mono.framework/Versions/Current/bin
;;
CYGWIN*|MINGW32*|MSYS*|MINGW*)
ACTION=vs2019
;;
case $(uname -s) in
CYGWIN*|MINGW32*|MSYS*|MINGW*)
ACTION=vs2019
;;
*)
ACTION=gmake
MONO=mono
export PATH=$PATH:/Library/Frameworks/Mono.framework/Versions/Current/bin
;;
esac
DIR=$( cd "$( dirname "$0" )" && pwd )
$DIR/InstallNugets.sh
OUT_DIR=$(find $DIR/$ACTION/lib/* -type d -maxdepth 0)
cp $DIR/../deps/NUnit/nunit.framework.* $OUT_DIR
$MONO $DIR/../deps/NUnit.Console-3.9.0/nunit3-console.exe --result=$OUT_DIR/TestResult.xml $OUT_DIR/*Tests*.dll

13
build/Setup.sh

@ -0,0 +1,13 @@ @@ -0,0 +1,13 @@
#!/bin/sh
set -e
DIR=$( cd "$( dirname "$0" )" && pwd )
case $(uname -s) in
CYGWIN*|MINGW32*|MSYS*|MINGW*)
;;
*)
$DIR/InstallMono.sh
;;
esac
$DIR/premake.sh --file=$DIR/scripts/LLVM.lua download_llvm --arch=$PLATFORM
Loading…
Cancel
Save