From 71e5192cbdadc03ade054e1822a1008c106949b5 Mon Sep 17 00:00:00 2001 From: Rawi01 Date: Sun, 24 Nov 2024 20:59:50 +0100 Subject: [PATCH] Add compile test step to Github Actions --- .github/workflows/ant.yml | 28 ++++++++++++++++++++++++++++ test/manual/compileTests/.gitignore | 1 + test/manual/compileTests/runTests.sh | 20 ++++++++++++++++++++ 3 files changed, 49 insertions(+) create mode 100644 test/manual/compileTests/.gitignore create mode 100755 test/manual/compileTests/runTests.sh diff --git a/.github/workflows/ant.yml b/.github/workflows/ant.yml index a216ebba60..d4275df675 100644 --- a/.github/workflows/ant.yml +++ b/.github/workflows/ant.yml @@ -183,3 +183,31 @@ jobs: - name: Compile in container run: docker run --entrypoint="" -v $(pwd)/lombok.jar:/workspace/lombok.jar $IMAGE_NAME /bin/bash -c "cd classpath; ${{ matrix.tool.cmd }}" + + manual-tests: + runs-on: ubuntu--24.04 + needs: build + strategy: + matrix: + jdk: [8, 11, 17, 21, 23] + dir: [compileTests] + fail-fast: false + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up JDK ${{ matrix.jdk }} + uses: actions/setup-java@v4 + with: + java-version: ${{ matrix.jdk }} + distribution: 'zulu' + + - uses: actions/download-artifact@v4 + with: + name: lombok.jar + + - name: Run tests + working-directory: ./test/manual/${{ matrix.dir }}/ + run: ./runTests.sh + diff --git a/test/manual/compileTests/.gitignore b/test/manual/compileTests/.gitignore new file mode 100644 index 0000000000..e2e7327cde --- /dev/null +++ b/test/manual/compileTests/.gitignore @@ -0,0 +1 @@ +/out diff --git a/test/manual/compileTests/runTests.sh b/test/manual/compileTests/runTests.sh new file mode 100755 index 0000000000..f99ffd97d3 --- /dev/null +++ b/test/manual/compileTests/runTests.sh @@ -0,0 +1,20 @@ +#!/bin/sh +set -e +echo 'This will compile a selection of files in test/transform/resource/before. If the compilation works without error, lombok is working as designed.' + +mkdir -p out/ + +# list of files to iterate over +FILES="UtilityClassInner.java" +BASE_PATH="../../../test/transform/resource/before" +LOMBOK_JAR="../../../dist/lombok.jar" + +# compile all files in list +for f in $FILES +do + + echo "Compiling $f" + javac --processor-path $LOMBOK_JAR -cp $LOMBOK_JAR -d out/ $BASE_PATH/$f +done + +rm -rf out/