Skip to content

Commit 1e46e3a

Browse files
separate compile and test steps
1 parent 08271b0 commit 1e46e3a

2 files changed

Lines changed: 30 additions & 25 deletions

File tree

.github/workflows/ci-build.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ jobs:
1717
java-version: ["8", "14", "17"]
1818
include:
1919
- java-version: "8"
20-
maven-opts: "-Djacoco.skip=true"
20+
maven-opts: "-Djacoco.skip=true -Xmx4g -Xms512m"
2121
- java-version: "14"
22-
maven-opts: ""
22+
maven-opts: "-Xmx4g -Xms512m"
2323
- java-version: "17"
24-
maven-opts: "-Djacoco.skip=true"
24+
maven-opts: "-Djacoco.skip=true -Xmx4g -Xms512m"
2525
permissions:
2626
contents: read
2727
steps:
@@ -33,13 +33,23 @@ jobs:
3333
with:
3434
java-version: ${{ matrix.java-version }}
3535
distribution: "adopt"
36-
- name: Run all tests
36+
- name: Compile
3737
run: |
3838
if [ ${{ matrix.java-version }} == "8" ]; then
3939
export TRAVIS_JDK=openjdk8
4040
fi
41-
./scripts/run_no_prep_tests.sh -ci
41+
./scripts/run_no_prep_tests.sh compile test-compile
4242
env:
43+
CI_ARGS: "--batch-mode -T 1C"
44+
MAVEN_OPTS: ${{ matrix.maven-opts }}
45+
- name: Run tests
46+
run: |
47+
if [ ${{ matrix.java-version }} == "8" ]; then
48+
export TRAVIS_JDK=openjdk8
49+
fi
50+
./scripts/run_no_prep_tests.sh surefire:test
51+
env:
52+
CI_ARGS: "--batch-mode"
4353
SKIP_UNSTABLE_TESTS: 1
4454
MAVEN_OPTS: ${{ matrix.maven-opts }}
4555
- name: Upload test results to Codecov

scripts/run_no_prep_tests.sh

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
11
#!/bin/bash
22

3-
flags()
4-
{
5-
while test $# -gt 0
6-
do
7-
case "$1" in
8-
-ci)
9-
CI_OPTIONS="--batch-mode -T 1C"
10-
;;
11-
*) usage;;
12-
esac
13-
shift
14-
done
15-
}
16-
flags "$@"
3+
# Usage: ./scripts/run_no_prep_tests.sh [goals...]
4+
#
5+
# Arguments: Maven phases/goals to run (default: clean test)
6+
#
7+
# Environment variables:
8+
# CI_ARGS - Additional Maven CLI options (e.g., "--batch-mode -T 1C")
9+
# TRAVIS_JDK - Set to "openjdk8" to use JDK 8 module exclusions
10+
11+
MVN_PHASES="${*:-clean test}"
1712

1813
is_jdk_8=`echo $JAVA_HOME | grep 8.`
1914
is_jdk_14=`echo $JAVA_HOME | grep 14.`
@@ -31,8 +26,8 @@ then
3126
-pl !bolt-http4k \
3227
-pl !bolt-micronaut \
3328
-pl !slack-jakarta-socket-mode-client \
34-
clean test \
35-
'-Dtest=test_locally.**.*Test' -Dsurefire.failIfNoSpecifiedTests=false ${CI_OPTIONS} \
29+
$MVN_PHASES \
30+
'-Dtest=test_locally.**.*Test' -Dsurefire.failIfNoSpecifiedTests=false ${CI_ARGS} \
3631
-DfailIfNoTests=false \
3732
-Dhttps.protocols=TLSv1.2 \
3833
--no-transfer-progress && \
@@ -41,16 +36,16 @@ elif [[ "${is_jdk_14}" != "" ]];
4136
then
4237
./mvnw \
4338
-pl !bolt-micronaut \
44-
clean test \
45-
'-Dtest=test_locally.**.*Test' -Dsurefire.failIfNoSpecifiedTests=false ${CI_OPTIONS} \
39+
$MVN_PHASES \
40+
'-Dtest=test_locally.**.*Test' -Dsurefire.failIfNoSpecifiedTests=false ${CI_ARGS} \
4641
-DfailIfNoTests=false \
4742
-Dhttps.protocols=TLSv1.2 \
4843
--no-transfer-progress && \
4944
if git status --porcelain | grep .; then git --no-pager diff; exit 1; fi
5045
else
5146
./mvnw \
52-
clean test \
53-
'-Dtest=test_locally.**.*Test' -Dsurefire.failIfNoSpecifiedTests=false ${CI_OPTIONS} \
47+
$MVN_PHASES \
48+
'-Dtest=test_locally.**.*Test' -Dsurefire.failIfNoSpecifiedTests=false ${CI_ARGS} \
5449
-DfailIfNoTests=false \
5550
-Dhttps.protocols=TLSv1.2 \
5651
--no-transfer-progress && \

0 commit comments

Comments
 (0)