From 3a8d7bdf82dddb8d5e54330503d9ed11b4f68ad0 Mon Sep 17 00:00:00 2001 From: KOBAYASHI Shuji Date: Fri, 8 Jan 2021 20:32:08 +0900 Subject: Delay test code build until `rake test` With this change, the test code will not be built unless `rake test` is run, so there will be almost no side effects even if `enable_test` is always set (but, gems specified by `add_test_dependency` are included in `libmruby.a`). Also added are `test: build` task, which only builds the test code (including the main code), and `test: run` task, which only runs tests independent of build. Therefore, the idiom for building in parallel and not running tests in parallel is `rake -m test:build && rake test:run`. --- .github/workflows/build.yml | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5e530ae5e..135e39ca7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,7 +25,7 @@ jobs: - name: Compiler version run: ${{ env.CC }} --version - name: Build and test - run: rake -m && rake test + run: rake -m test:build && rake test:run Ubuntu-1804-gcc: needs: Check-Skip @@ -40,7 +40,7 @@ jobs: - name: Compiler version run: ${{ env.CC }} --version - name: Build and test - run: rake -m && rake test + run: rake -m test:build && rake test:run Ubuntu-1804-clang: needs: Check-Skip @@ -55,7 +55,7 @@ jobs: - name: Compiler version run: ${{ env.CC }} --version - name: Build and test - run: rake -m && rake test + run: rake -m test:build && rake test:run macOS: needs: Check-Skip @@ -70,7 +70,7 @@ jobs: - name: Compiler version run: ${{ env.CC }} --version - name: Build and test - run: rake -m && rake test + run: rake -m test:build && rake test:run Windows-MinGW: needs: Check-Skip @@ -85,9 +85,7 @@ jobs: - name: Compiler version run: ${{ env.CC }} --version - name: Build and test - # If build and test are separated like `rake && rake test`, somehow - # it will be fully built even at `rake test`, so it is not separated. - run: rake test + run: rake -m test:build && rake test:run Windows-Cygwin: needs: Check-Skip @@ -130,7 +128,7 @@ jobs: run: ${{ env.CC }} --version - name: Build and test shell: cmd - run: ruby /usr/bin/rake -m && ruby /usr/bin/rake test + run: ruby /usr/bin/rake -m test:build && ruby /usr/bin/rake test:run - name: Set PATH for cache archiving (tar) # set Windows path so that Cygwin tar is not used for cache archiving run: echo '::set-env name=PATH::C:\windows\System32' @@ -148,4 +146,4 @@ jobs: shell: cmd run: | call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" - rake -m && rake test + rake -m test:build && rake test:run -- cgit v1.2.3