From 6709896dfe511f153fc56fec0428ee6995b28fcb Mon Sep 17 00:00:00 2001 From: Sam Gammon Date: Sat, 7 Jun 2025 13:13:07 -0700 Subject: [PATCH] chore: initial ci jobs chore: add build job chore: add pr job hook chore: add push job hook Signed-off-by: Sam Gammon --- .github/workflows/job.build.yml | 50 +++++++++++++++++++++++++++++++++ .github/workflows/on.pr.yml | 17 +++++++++++ .github/workflows/on.push.yml | 19 +++++++++++++ 3 files changed, 86 insertions(+) create mode 100644 .github/workflows/job.build.yml create mode 100644 .github/workflows/on.pr.yml create mode 100644 .github/workflows/on.push.yml diff --git a/.github/workflows/job.build.yml b/.github/workflows/job.build.yml new file mode 100644 index 0000000..6dfbbd1 --- /dev/null +++ b/.github/workflows/job.build.yml @@ -0,0 +1,50 @@ +name: "Build" + +"on": + workflow_call: + inputs: + runner: + description: "Runner" + required: false + type: string + default: "ubuntu-latest" + workflow_dispatch: + inputs: + runner: + description: "Runner" + required: false + type: string + default: "ubuntu-latest" + +permissions: + contents: "read" + +jobs: + build: + name: "Maven Plugin" + runs-on: ${{ inputs.runner || 'ubuntu-latest' }} + permissions: + contents: "read" + steps: + - name: "Setup: Harden Runner" + uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0 + with: + disable-sudo: true + egress-policy: audit + - name: "Setup: Checkout" + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + fetch-depth: 1 + persist-credentials: false + - name: "Setup: JDK" + uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1 + with: + distribution: graalvm + java-version: "24" + - name: "Setup: Elide" + uses: elide-dev/setup-elide@990b915b2974a70e7654acb1303607b4cd1d3538 # v2.0.0 + - name: "Build: Plugin" + run: ./gradlew build publishToMavenLocal + - name: "Test: Plugin" + working-directory: sample + run: ./mvnw clean package diff --git a/.github/workflows/on.pr.yml b/.github/workflows/on.pr.yml new file mode 100644 index 0000000..31314cd --- /dev/null +++ b/.github/workflows/on.pr.yml @@ -0,0 +1,17 @@ +name: "PR" + +"on": + pull_request: {} + +permissions: + contents: "read" + +jobs: + build: + name: "Build" + uses: ./.github/workflows/job.build.yml + secrets: inherit + permissions: + contents: "read" + with: + runner: "ubuntu-latest" diff --git a/.github/workflows/on.push.yml b/.github/workflows/on.push.yml new file mode 100644 index 0000000..f4495f9 --- /dev/null +++ b/.github/workflows/on.push.yml @@ -0,0 +1,19 @@ +name: "CI" + +"on": + push: + branches: + - main + +permissions: + contents: "read" + +jobs: + build: + name: "Build" + uses: ./.github/workflows/job.build.yml + secrets: inherit + permissions: + contents: "read" + with: + runner: "ubuntu-latest"