Skip to content

Commit

Permalink
new script + new ci with 2 jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelchassot committed Sep 4, 2024
1 parent 63bd368 commit c75ba8d
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 24 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/stainless-CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,18 @@ jobs:
- name: Build and Package
run: ./stainless-ci.sh --build-only
- name: Run Tests and Integration Tests
run: ./stainless-ci.sh --quick --skip-build
run: ./stainless-ci.sh --skip-build --skip-bolts --skip-sbt-plugin
bolts-sbt-plugin:
runs-on: ubuntu-latest
env:
# define Java options for both official sbt and sbt-extras
JAVA_OPTS: -Dsbt.io.implicit.relative.glob.conversion=allow -Xss512M -Xms1024M -Xmx12G -XX:MaxMetaspaceSize=2G -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=768M
JVM_OPTS: -Dsbt.io.implicit.relative.glob.conversion=allow -Xss512M -Xms1024M -Xmx12G -XX:MaxMetaspaceSize=2G -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=768M
steps:
- name: Build and Package
run: ./stainless-ci.sh --build-only
- name: Bolts Tests
run: ./stainless-ci.sh --bolts-only --skip-build
run: ./stainless-ci.sh --skip-build --skip-tests --skip-sbt-plugin
- name: Sbt Plugin Tests
run: ./stainless-ci.sh --skip-build --skip-tests --skip-bolts

68 changes: 46 additions & 22 deletions stainless-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
# Record the time to compute the total duration
TIME_BEFORE=$(date +%s)

BOLTS_ONLY=false
BUILD_ONLY=false
QUICK=false
SKIP_BOLTS=false
SKIP_BUILD=false
SKIP_SBT_PLUGIN=false
SKIP_TESTS=false

# First parse the options
while [[ $# -gt 0 ]]; do
Expand All @@ -28,16 +29,20 @@ while [[ $# -gt 0 ]]; do
BUILD_ONLY=true
shift # past argument
;;
--quick)
QUICK=true
--skip-bolts)
SKIP_BOLTS=true
shift # past argument
;;
--skip-build)
SKIP_BUILD=true
shift # past argument
;;
--bolts-only)
BOLTS_ONLY=true
--skip-sbt-plugin)
SKIP_SBT_PLUGIN=true
shift # past argument
;;
--skip-tests)
SKIP_TESTS=true
shift # past argument
;;
*) # unknown option
Expand All @@ -52,12 +57,13 @@ usage() {
Usage: external-tests.sh [options]
-h | -help Print this message
--skip-build Do not build the project (saves time if the build is already up-to-date).
--bolts-dir Directory where bolts is located (default: clones from GitHub).
--build-only Only build the project, do not run tests.
--quick Skip the bolts tests.
--bolts-only Only run the bolts tests.
--skip-build Do not build the project (saves time if the build is already up-to-date).
--skip-bolts Do not run the Bolts benchmarks.
--skip-sbt-plugin Do not run the sbt plugin tests.
--skip-tests Do not run the unit and integration tests.
EOM
}

Expand All @@ -75,7 +81,9 @@ else
fi
fi

if [ "$BOLTS_ONLY" = false ]; then
if [ "$SKIP_TESTS" = true ]; then
echo "************** Skipping tests **************"
else
# Run the tests
sbt -batch -Dtestsuite-parallelism=5 test
if [ $? -ne 0 ]; then
Expand All @@ -92,23 +100,39 @@ if [ "$BOLTS_ONLY" = false ]; then

fi

if [ "$QUICK" = true ]; then
echo "************** Quick mode, skipping bolts tests **************"
exit 0
fi

# Run the Bolts benchmarks
# if BOLTS_DIR is set, pass it to the script
if [ -z "$BOLTS_DIR" ]; then
bash bin/external-tests.sh --skip-build
if [ "$SKIP_BOLTS" = true ]; then
echo "************** Skipping Bolts tests **************"
else
bash bin/external-tests.sh --skip-build --bolts-dir $BOLTS_DIR
if [ -z "$BOLTS_DIR" ]; then
bash bin/external-tests.sh --skip-build
else
bash bin/external-tests.sh --skip-build --bolts-dir $BOLTS_DIR
fi
if [ $? -ne 0 ]; then
echo "Bolts benchmarks failed"
exit 1
fi
fi
if [ $? -ne 0 ]; then
echo "Bolts benchmarks failed"
exit 1

# Run sbt scripted
if [ "$SKIP_SBT_PLUGIN" = true ]; then
echo "************** Skipping sbt plugin tests **************"
else
sbt -batch scripted
if [ $? -ne 0 ]; then
echo "sbt scripted failed"
exit 1
fi
fi

# bash bin/build-slc-lib.sh
# if [ $? -ne 0 ]; then
# echo "build-slc-lib.sh failed"
# exit 1
# fi

TIME_AFTER=$(date +%s)
DURATION=$((TIME_AFTER - TIME_BEFORE))

Expand Down

0 comments on commit c75ba8d

Please sign in to comment.