From c630dc0b925b632b474f6b1fd7e8271d2fb86fa9 Mon Sep 17 00:00:00 2001 From: "Thomas L. Kjeldsen" Date: Fri, 31 Jan 2020 12:52:10 +0100 Subject: [PATCH 1/3] Build and run tests on GitHub-hosted runners A GitHub-hosted runner is a virtual machine hosted by GitHub with the GitHub Actions runner application installed. --- .github/workflows/ant.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/ant.yml diff --git a/.github/workflows/ant.yml b/.github/workflows/ant.yml new file mode 100644 index 000000000..6ed31e9c4 --- /dev/null +++ b/.github/workflows/ant.yml @@ -0,0 +1,21 @@ +name: Java CI + +on: [push] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + - name: Build with Ant + working-directory: ./build + run: ant clean dist + - name: Run tests + working-directory: ./app + run: ant test From ab8471d562990e9c0f59215c6642ab12caea55bc Mon Sep 17 00:00:00 2001 From: "Thomas L. Kjeldsen" Date: Fri, 31 Jan 2020 12:52:19 +0100 Subject: [PATCH 2/3] Don't require user interaction when building the dist target --- .github/workflows/ant.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ant.yml b/.github/workflows/ant.yml index 6ed31e9c4..f79d08d5d 100644 --- a/.github/workflows/ant.yml +++ b/.github/workflows/ant.yml @@ -15,7 +15,9 @@ jobs: java-version: 1.8 - name: Build with Ant working-directory: ./build - run: ant clean dist + run: | + sed -i 's###' build.xml + ant clean dist - name: Run tests working-directory: ./app run: ant test From b4e5a8f7de560b8b25b2d0cca27d57f7e02941a5 Mon Sep 17 00:00:00 2001 From: "Thomas L. Kjeldsen" Date: Fri, 31 Jan 2020 12:52:26 +0100 Subject: [PATCH 3/3] Run tests with an X virtual framebuffer (1024x768) The GitHub-hosted runner is a virtual machine hosted by GitHub. Xvfb on that setup defaults to a virtual screen size of 640x480 (XVFBARGS='-screen 0 640x480x16') which in turn makes the Arduino user interface tests fail with exceptions like this: [junit] org.fest.swing.exception.ActionFailedException: The component to click is out of the boundaries of the screen [junit] at org.fest.swing.exception.ActionFailedException.actionFailure(ActionFailedException.java:33) [junit] at org.fest.swing.core.RobotEventGenerator.pressMouse(RobotEventGenerator.java:74) Setting the xvfb screen size to 1024x768 solves this error. --- .github/workflows/ant.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ant.yml b/.github/workflows/ant.yml index f79d08d5d..a0a91efa9 100644 --- a/.github/workflows/ant.yml +++ b/.github/workflows/ant.yml @@ -18,6 +18,10 @@ jobs: run: | sed -i 's###' build.xml ant clean dist + - name: Install X virtual framebuffer + run: sudo apt-get install -y xvfb - name: Run tests working-directory: ./app - run: ant test + run: xvfb-run --auto-servernum --server-args "-screen 0 1024x768x24" ant test + - name: Cleanup xvfb + uses: bcomnes/cleanup-xvfb@v1