Skip to content

Commit

Permalink
sync github builds across all plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
hgschmie committed Sep 14, 2024
1 parent f0ee2c5 commit 50e9741
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 33 deletions.
26 changes: 14 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: CI build
---
name: CI Build with tests

on:
push:
Expand All @@ -13,35 +14,36 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
test-java-version: [ 11, 17, 21 ]
java-version: [ 11, 17, 21, 22 ]

steps:
- uses: actions/checkout@v4
with:
fetch-tags: true
fetch-depth: 0

- uses: actions/setup-java@v4
id: setup_build_jdk
name: Setup Build JDK
id: build_jdk
with:
java-version: 21
distribution: temurin
cache: maven

- name: Build
- name: build distribution
env:
MAVEN_ARGS: "-Pfast -Dbasepom.check.skip-enforcer=false -B -fae"
MAVEN_ARGS: "-Dbasepom.check.skip-enforcer=false -B -fae"
run: |
make install
make install-fast
- uses: actions/setup-java@v4
id: setup_test_jdk
name: Setup Test JDK
id: test_jdk
with:
java-version: ${{ matrix.test-java-version }}
java-version: ${{ matrix.java-version }}
distribution: temurin
cache: maven

- name: Run unit tests
- name: run tests
env:
MAVEN_ARGS: "-Dbasepom.it.fork-count=1 -B -fae"
MAVEN_ARGS: "-B -fae"
run: |
make run-tests
33 changes: 20 additions & 13 deletions .github/workflows/master-cd.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: CD (Snapshot deployment)

on:
Expand All @@ -11,12 +12,14 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
fetch-tags: true
fetch-depth: 0

- name: setup build jdk
uses: actions/setup-java@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
distribution: temurin
cache: maven
server-id: sonatype-nexus-snapshots
server-username: NEXUS_REPO_USER
Expand All @@ -27,30 +30,34 @@ jobs:
NEXUS_REPO_USER: ${{ secrets.NEXUS_REPO_USER }}
NEXUS_REPO_PASSWORD: ${{ secrets.NEXUS_REPO_PASSWORD }}
MAVEN_ARGS: "-B -fae"
run: make deploy
run: |
make deploy
site:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-tags: true
fetch-depth: 0

- name: Set git information
- name: configure git user
run: |
git config --global user.name github-actions
git config --global user.email github-actions@github.com
git config --global user.name github-cd-action
git config --global user.email github-cd-action@basepom.org
- name: setup build jdk
uses: actions/setup-java@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
distribution: temurin
cache: maven
server-id: github
server-password: SITE_DEPLOY

- name: deploy documentation
- name: publish docs
env:
SITE_DEPLOY: ${{ secrets.SITE_DEPLOY_TOKEN }}
MAVEN_ARGS: "-Dbasepom.it.skip=false -Dbasepom.it.fork-count=1 -B -fae"
run: make deploy-site
MAVEN_ARGS: "-B -fae"
run: |
make deploy-site
32 changes: 32 additions & 0 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: Code style analysis

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
style:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-tags: true
fetch-depth: 0

- uses: actions/setup-java@v4
with:
java-version: 21
distribution: temurin
cache: maven

- name: run code checkers
env:
MAVEN_ARGS: "-B -fae"
run: |
make install-notests
22 changes: 14 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,16 @@ export MAVEN_OPTS MAVEN_ARGS

default:: help

Makefile:: ;

clean::
${MAVEN} clean

install::
${MAVEN} clean install

tests: install-fast run-tests

install-fast:: MAVEN_ARGS += -Pfast
install-fast:: install

Expand All @@ -38,8 +42,9 @@ run-tests::
deploy::
${MAVEN} clean deploy

deploy-site::
${MAVEN} clean install site-deploy
deploy-site:: MAVEN_ARGS += -Dbasepom.it.skip=false
deploy-site:: install
${MAVEN} site-deploy

release::
${MAVEN} clean release:clean release:prepare release:perform
Expand All @@ -49,11 +54,12 @@ release-site:: deploy-site

help::
@echo " * clean - clean local build tree"
@echo " * install - installs build result in the local maven repository"
@echo " * install-fast - like install, but do not run tests and checkers"
@echo " * install-notests - like install, but do not run tests"
@echo " * deploy - installs build result in the snapshot OSS repository"
@echo " * test - run unit tests"
@echo " * install - build, run static analysis and unit tests, then install in the local repository"
@echo " * install-fast - same as 'install', but skip unit tests and static analysis"
@echo " * install-notests - same as 'install', but skip unit tests"
@echo " * tests - build code and run unit and integration tests"
@echo " * run-tests - run all unit and integration tests except really slow tests"
@echo " * deploy - builds and deploys the current version to the Sonatype OSS repository"
@echo " * deploy-site - builds and deploys the documentation site"
@echo " * release - release a new version to maven central"
@echo " * release-site - run from release directory to deploy new doc site"
@echo " * release-site - run from release directory to deploy the documentation site for a release"

0 comments on commit 50e9741

Please sign in to comment.