diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml new file mode 100644 index 0000000..f0bf258 --- /dev/null +++ b/.github/workflows/builds.yml @@ -0,0 +1,43 @@ + +name: builds + +on: [push, pull_request] + +jobs: + build-windows: + runs-on: windows-2019 + steps: + - name: checkout + uses: actions/checkout@v2 + - name: build + shell: cmd + run: | + call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" amd64 + "C:\Program Files\Git\bin\bash.exe" "bin/bld_init.sh" + "C:\Program Files\Git\bin\bash.exe" "bin/all_dev_checks.sh" + + build-linux: + runs-on: ubuntu-20.04 + steps: + - name: checkout + uses: actions/checkout@v2 + - name: build + shell: bash + run: | + ./bin/bld_init.sh + sed -i.bak 's/cl/clang/' local/compiler.sh + sed -i.bak 's/lld-link/clang/' local/linker.sh + ./bin/all_dev_checks.sh + + build-macos: + runs-on: macos-11 + steps: + - name: checkout + uses: actions/checkout@v2 + - name: build + shell: bash + run: | + ./bin/bld_init.sh + sed -i.bak 's/cl/clang/' local/compiler.sh + sed -i.bak 's/lld-link/clang/' local/linker.sh + ./bin/all_dev_checks.sh diff --git a/bin/all_dev_checks.sh b/bin/all_dev_checks.sh index c3fc42f..5aaf4de 100755 --- a/bin/all_dev_checks.sh +++ b/bin/all_dev_checks.sh @@ -1,5 +1,7 @@ #!/bin/bash +set -eo pipefail + ###### Get Paths ############################################################## og_path=$PWD cd "$(dirname "$0")" diff --git a/bin/bld_core.sh b/bin/bld_core.sh index 53236f0..67f40fc 100755 --- a/bin/bld_core.sh +++ b/bin/bld_core.sh @@ -1,5 +1,7 @@ #!/bin/bash +set -eo pipefail + ###### Usage ################################################################## # ./bld_core.sh [arguments ...] # @@ -548,8 +550,8 @@ if [ "$OSTYPE" == "win32" ] || os="windows" elif [ "$OSTYPE" == "linux-gnu" ]; then os="linux" -elif [ "$OSTYPE" == "darwin" ]; then - os="osx" +elif [[ "$OSTYPE" == "darwin"* ]]; then + os="mac" fi @@ -593,13 +595,11 @@ fi ###### Binary File Extension ################################################## -dot_ext_exe="" +dot_ext_exe=".exe" dot_ext_dll="" if [ "$os" == "windows" ]; then - dot_ext_exe=".exe" dot_ext_dll=".dll" elif [ "$os" == "linux" ] || [ "$os" == "mac" ]; then - dot_ext_exe="" dot_ext_dll=".so" else echo "ERROR: binary extension not defined for OS: $os" diff --git a/bin/bld_init.sh b/bin/bld_init.sh index 6e4b212..2edb283 100755 --- a/bin/bld_init.sh +++ b/bin/bld_init.sh @@ -1,5 +1,7 @@ #!/bin/bash +set -eo pipefail + ###### Usage ################################################################## # ./bld_init.sh # Clears out the local folder and populates it with default initial scripts. diff --git a/bin/build_examples.sh b/bin/build_examples.sh index ca7c95b..312fa56 100755 --- a/bin/build_examples.sh +++ b/bin/build_examples.sh @@ -1,5 +1,7 @@ #!/bin/bash +set -eo pipefail + ###### Get Paths ############################################################## og_path=$PWD cd "$(dirname "$0")" diff --git a/bin/build_tests.sh b/bin/build_tests.sh index 65d48be..46bd735 100755 --- a/bin/build_tests.sh +++ b/bin/build_tests.sh @@ -1,5 +1,7 @@ #!/bin/bash +set -eo pipefail + ###### Get Paths ############################################################## og_path=$PWD cd "$(dirname "$0")" diff --git a/bin/local_defaults/default_arch.sh b/bin/local_defaults/default_arch.sh old mode 100644 new mode 100755 diff --git a/bin/local_defaults/default_compile_mode.sh b/bin/local_defaults/default_compile_mode.sh old mode 100644 new mode 100755 diff --git a/bin/local_defaults/default_compiler.sh b/bin/local_defaults/default_compiler.sh old mode 100644 new mode 100755 diff --git a/bin/local_defaults/default_ctx.sh b/bin/local_defaults/default_ctx.sh old mode 100644 new mode 100755 diff --git a/bin/local_defaults/default_linker.sh b/bin/local_defaults/default_linker.sh old mode 100644 new mode 100755 diff --git a/bin/run_examples.sh b/bin/run_examples.sh index 0c9a82e..0b0f24f 100755 --- a/bin/run_examples.sh +++ b/bin/run_examples.sh @@ -1,5 +1,7 @@ #!/bin/bash +set -eo pipefail + ###### Get Paths ############################################################## og_path=$PWD cd "$(dirname "$0")" @@ -12,8 +14,6 @@ echo ~~~ Running Expression Intro ~~~ $build_path/expr_intro.exe $examps/expr/expr_intro.mdesk echo -exit - # Setup a big list of files for a few of the examples big_list=() big_list+=("$examps/intro/hello_world.mdesk") diff --git a/bin/run_tests.sh b/bin/run_tests.sh index d0af4d4..cd8a043 100755 --- a/bin/run_tests.sh +++ b/bin/run_tests.sh @@ -1,5 +1,7 @@ #!/bin/bash +set -eo pipefail + ###### Get Paths ############################################################## og_path=$PWD cd "$(dirname "$0")" diff --git a/examples/expr/expr_c_like.c b/examples/expr/expr_c_like.c index 6ae99c3..fecacd1 100644 --- a/examples/expr/expr_c_like.c +++ b/examples/expr/expr_c_like.c @@ -181,7 +181,7 @@ int main(int argc, char **argv) #if 1 char *argv_dummy[2] = { 0, - "W:\\metadesk\\examples\\expr\\expr_c_like.mdesk", + "examples/expr/expr_c_like.mdesk", }; argc = 2; argv = argv_dummy; diff --git a/examples/expr/expr_intro.c b/examples/expr/expr_intro.c index 1c3552f..7a93860 100644 --- a/examples/expr/expr_intro.c +++ b/examples/expr/expr_intro.c @@ -130,7 +130,7 @@ int main(int argc, char **argv) #if 1 char *argv_dummy[2] = { 0, - "W:\\metadesk\\examples\\expr\\expr_intro.mdesk", + "examples/expr/expr_intro.mdesk", }; argc = 2; argv = argv_dummy;