Skip to content

Also resolve Maven plugin dependencies during setup #2

Also resolve Maven plugin dependencies during setup

Also resolve Maven plugin dependencies during setup #2

name: "Copilot Setup Steps"
# Automatically run the setup steps when they are changed to allow for easy validation, and
# allow manual testing through the repository's "Actions" tab
on:
workflow_dispatch:
push:
paths:
- .github/workflows/copilot-setup-steps.yml
pull_request:
paths:
- .github/workflows/copilot-setup-steps.yml
jobs:
# The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot.
copilot-setup-steps:
runs-on: ubuntu-latest
# Set the permissions to the lowest permissions possible needed for your steps.
# Copilot will be given its own token for its operations.
permissions:
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: maven
# Pre-download all Maven dependencies (including from central.sonatype.com and
# checkstyle.org) during setup, which is exempt from the agent's firewall.
# This ensures the agent can build, test, and lint without needing network access
# to those hosts at runtime.
- name: Pre-download Maven dependencies
run: mvn --batch-mode dependency:go-offline dependency:resolve-plugins -Dgpg.skip
- name: Pre-download Maven plugin dependencies
run: mvn --batch-mode fmt:check checkstyle:check --fail-never -Dgpg.skip