ci: skip release-small tests to save time

we keep hitting the limit on how long CI tests take to run.
master
Andrew Kelley 2018-09-12 14:50:26 -04:00
parent a757533386
commit 869475c110
No known key found for this signature in database
GPG Key ID: 4E7CD66038A4D47C
4 changed files with 23 additions and 10 deletions

View File

@ -62,6 +62,9 @@ pub fn build(b: *Builder) !void {
b.default_step.dependOn(&exe.step); b.default_step.dependOn(&exe.step);
const skip_release = b.option(bool, "skip-release", "Main test suite skips release builds") orelse false; const skip_release = b.option(bool, "skip-release", "Main test suite skips release builds") orelse false;
const skip_release_small = b.option(bool, "skip-release-small", "Main test suite skips release-small builds") orelse skip_release;
const skip_release_fast = b.option(bool, "skip-release-fast", "Main test suite skips release-fast builds") orelse skip_release;
const skip_release_safe = b.option(bool, "skip-release-safe", "Main test suite skips release-safe builds") orelse skip_release;
const skip_self_hosted = b.option(bool, "skip-self-hosted", "Main test suite skips building self hosted compiler") orelse false; const skip_self_hosted = b.option(bool, "skip-self-hosted", "Main test suite skips building self hosted compiler") orelse false;
if (!skip_self_hosted) { if (!skip_self_hosted) {
test_step.dependOn(&exe.step); test_step.dependOn(&exe.step);
@ -83,13 +86,23 @@ pub fn build(b: *Builder) !void {
test_step.dependOn(test_stage2_step); test_step.dependOn(test_stage2_step);
} }
const all_modes = []builtin.Mode{ var chosen_modes: [4]builtin.Mode = undefined;
builtin.Mode.Debug, var chosen_mode_index: usize = 0;
builtin.Mode.ReleaseSafe, chosen_modes[chosen_mode_index] = builtin.Mode.Debug;
builtin.Mode.ReleaseFast, chosen_mode_index += 1;
builtin.Mode.ReleaseSmall, if (!skip_release_safe) {
}; chosen_modes[chosen_mode_index] = builtin.Mode.ReleaseSafe;
const modes = if (skip_release) []builtin.Mode{builtin.Mode.Debug} else all_modes; chosen_mode_index += 1;
}
if (!skip_release_fast) {
chosen_modes[chosen_mode_index] = builtin.Mode.ReleaseFast;
chosen_mode_index += 1;
}
if (!skip_release_small) {
chosen_modes[chosen_mode_index] = builtin.Mode.ReleaseSmall;
chosen_mode_index += 1;
}
const modes = chosen_modes[0..chosen_mode_index];
test_step.dependOn(tests.addPkgTests(b, test_filter, "test/behavior.zig", "behavior", "Run the behavior tests", modes)); test_step.dependOn(tests.addPkgTests(b, test_filter, "test/behavior.zig", "behavior", "Run the behavior tests", modes));

View File

@ -23,4 +23,4 @@ cd %ZIGBUILDDIR%
cmake.exe .. -Thost=x64 -G"Visual Studio 14 2015 Win64" "-DCMAKE_INSTALL_PREFIX=%ZIGBUILDDIR%" "-DCMAKE_PREFIX_PATH=%ZIGPREFIXPATH%" -DCMAKE_BUILD_TYPE=Release || exit /b cmake.exe .. -Thost=x64 -G"Visual Studio 14 2015 Win64" "-DCMAKE_INSTALL_PREFIX=%ZIGBUILDDIR%" "-DCMAKE_PREFIX_PATH=%ZIGPREFIXPATH%" -DCMAKE_BUILD_TYPE=Release || exit /b
msbuild /p:Configuration=Release INSTALL.vcxproj || exit /b msbuild /p:Configuration=Release INSTALL.vcxproj || exit /b
bin\zig.exe build --build-file ..\build.zig test || exit /b bin\zig.exe build --build-file ..\build.zig test -Dskip-release-small || exit /b

View File

@ -10,7 +10,7 @@ mkdir build
cd build cd build
cmake .. -DCMAKE_BUILD_TYPE=Release cmake .. -DCMAKE_BUILD_TYPE=Release
make -j2 install make -j2 install
./zig build --build-file ../build.zig test ./zig build --build-file ../build.zig test -Dskip-release-small
if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then
mkdir $TRAVIS_BUILD_DIR/artifacts mkdir $TRAVIS_BUILD_DIR/artifacts

View File

@ -9,4 +9,4 @@ cmake .. -DCMAKE_PREFIX_PATH=/usr/local/opt/llvm@6/ -DCMAKE_BUILD_TYPE=Release
make VERBOSE=1 make VERBOSE=1
make install make install
./zig build --build-file ../build.zig test ./zig build --build-file ../build.zig test -Dskip-release-small