mirror of
https://github.com/jlengrand/error-prone-support.git
synced 2026-03-10 08:11:25 +00:00
64 lines
2.8 KiB
YAML
64 lines
2.8 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: Review whether then build matrix should also vary JDK or OS versions.
|
|
# XXX: Support `/integration-test [name...]` comment syntax to specify the
|
|
# subset of integration tests to 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-24.04
|
|
strategy:
|
|
matrix:
|
|
integration-test: [ "checkstyle", "metrics", "prometheus-java-client" ]
|
|
steps:
|
|
- name: Install Harden-Runner
|
|
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
|
|
with:
|
|
disable-sudo: true
|
|
egress-policy: block
|
|
# XXX: After updating the validation build flags in
|
|
# `integration-tests/prometheus-java-client.sh`, review whether the
|
|
# Docker domains specified here can be dropped.
|
|
allowed-endpoints: >
|
|
api.adoptium.net:443
|
|
auth.docker.io:443
|
|
checkstyle.org:443
|
|
example.com:80
|
|
github.com:443
|
|
objects.githubusercontent.com:443
|
|
oss.sonatype.org:443
|
|
production.cloudflare.docker.com:443
|
|
raw.githubusercontent.com:443
|
|
registry-1.docker.io:443
|
|
repo.maven.apache.org:443
|
|
repository.sonatype.org:443
|
|
- name: Check out code and set up JDK and Maven
|
|
uses: s4u/setup-maven-action@4f7fb9d9675e899ca81c6161dadbba0189a4ebb1 # v1.18.0
|
|
with:
|
|
checkout-ref: "refs/pull/${{ github.event.issue.number }}/head"
|
|
java-version: 17.0.13
|
|
java-distribution: temurin
|
|
maven-version: 3.9.9
|
|
- name: Install project to local Maven repository
|
|
run: mvn -T1C install -DskipTests -Dverification.skip
|
|
- name: Run integration test
|
|
run: xvfb-run "./integration-tests/${{ matrix.integration-test }}.sh" "${{ runner.temp }}/artifacts"
|
|
- name: Upload artifacts on failure
|
|
if: ${{ failure() }}
|
|
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
|
|
with:
|
|
name: "integration-test-${{ matrix.integration-test }}"
|
|
path: "${{ runner.temp }}/artifacts"
|
|
- name: Remove installed project artifacts
|
|
run: mvn dependency:purge-local-repository -DmanualInclude='${project.groupId}' -DresolutionFuzziness=groupId
|