mirror of
https://github.com/jlengrand/error-prone-support.git
synced 2026-03-10 08:11:25 +00:00
Using the `setup-maven-action` GitHub action we can both simplify the build configuration and configure the version of Maven to use. See https://github.com/s4u/setup-maven-action
40 lines
1.7 KiB
YAML
40 lines
1.7 KiB
YAML
# If requested by means of a pull request comment, runs integration tests
|
|
# against the project, using the code found on the pull request branch.
|
|
# XXX: Generalize this to a matrix build of multiple integration tests,
|
|
# possibly using multiple JDK or OS versions.
|
|
# XXX: Investigate whether the comment can specify which integration tests run
|
|
# run. See this example of a dynamic build matrix:
|
|
# https://docs.github.com/en/actions/learn-github-actions/expressions#example-returning-a-json-object
|
|
name: "Integration tests"
|
|
on:
|
|
issue_comment:
|
|
types: [ created ]
|
|
permissions:
|
|
contents: read
|
|
jobs:
|
|
run-integration-tests:
|
|
name: On-demand integration test
|
|
if: |
|
|
github.event.issue.pull_request && contains(github.event.comment.body, '/integration-test')
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- name: Check out code and set up JDK and Maven
|
|
uses: s4u/setup-maven-action@fa2c7e4517ed008b1f73e7e0195a9eecf5582cd4 # v1.11.0
|
|
with:
|
|
checkout-ref: "refs/pull/${{ github.event.issue.number }}/head"
|
|
java-version: 17.0.8
|
|
java-distribution: temurin
|
|
maven-version: 3.9.6
|
|
- name: Install project to local Maven repository
|
|
run: mvn -T1C install -DskipTests -Dverification.skip
|
|
- name: Run integration test
|
|
run: xvfb-run ./integration-tests/checkstyle-10.12.4.sh "${{ runner.temp }}/artifacts"
|
|
- name: Upload artifacts on failure
|
|
if: ${{ failure() }}
|
|
uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4.0.0
|
|
with:
|
|
name: integration-test-checkstyle-10.12.4
|
|
path: "${{ runner.temp }}/artifacts"
|
|
- name: Remove installed project artifacts
|
|
run: mvn build-helper:remove-project-artifact
|