From 3ac50b2acf03fee31cf4668bdb53d3c0599fba85 Mon Sep 17 00:00:00 2001 From: Guus Lieben Date: Sat, 10 Aug 2024 11:57:50 +0200 Subject: [PATCH] #1049 Set up singular pull request CI workflow --- .github/workflows/build.docs.yml | 8 +++-- .github/workflows/build.modules.yml | 4 +-- .github/workflows/check.codestyle.yml | 5 ++- .github/workflows/check.dependency.yml | 5 ++- .github/workflows/check.license.yml | 5 ++- .github/workflows/test.coverage.yml | 2 +- .github/workflows/workflow.pull_request.yml | 36 +++++++++++++++++++ .../environment/ApplicationEnvironment.java | 1 + 8 files changed, 51 insertions(+), 15 deletions(-) create mode 100644 .github/workflows/workflow.pull_request.yml diff --git a/.github/workflows/build.docs.yml b/.github/workflows/build.docs.yml index 7cb63582c..f7dd9cc9d 100644 --- a/.github/workflows/build.docs.yml +++ b/.github/workflows/build.docs.yml @@ -1,6 +1,6 @@ name: Build documentation -on: [pull_request, workflow_dispatch] +on: workflow_call jobs: buildDocs: @@ -13,12 +13,14 @@ jobs: with: java-version: 21 distribution: temurin - - name: Build documentation + - name: Build developer documentation run: mvn clean antora:antora -P ci -Dantora.skip=false -Dantora.playbook=playbook-local.yml + - name: Build Javadocs + run: mvn javadoc:aggregate -P ci -Djavadoc.skip=false - name: Archive documentation artifacts uses: actions/upload-artifact@v4 with: name: Documentation archive path: target/site if-no-files-found: error - retention-days: 7 + retention-days: 7 \ No newline at end of file diff --git a/.github/workflows/build.modules.yml b/.github/workflows/build.modules.yml index e235eb460..71915fe0e 100644 --- a/.github/workflows/build.modules.yml +++ b/.github/workflows/build.modules.yml @@ -1,6 +1,6 @@ -name: Build all +name: Build modules -on: [pull_request, workflow_dispatch] +on: workflow_call jobs: buildSource: diff --git a/.github/workflows/check.codestyle.yml b/.github/workflows/check.codestyle.yml index ce6e1483d..c1426aef1 100644 --- a/.github/workflows/check.codestyle.yml +++ b/.github/workflows/check.codestyle.yml @@ -1,12 +1,11 @@ -name: Checkstyle +name: Check code style -on: [pull_request, workflow_dispatch] +on: workflow_call jobs: depCheck: name: Checkstyle runs-on: ubuntu-latest - steps: - uses: actions/checkout@v4 - name: Set up JDK 21 diff --git a/.github/workflows/check.dependency.yml b/.github/workflows/check.dependency.yml index 7b9f49080..b0e894eed 100644 --- a/.github/workflows/check.dependency.yml +++ b/.github/workflows/check.dependency.yml @@ -1,12 +1,11 @@ -name: OWASP Dependency Check +name: check_dependency -on: [pull_request, workflow_dispatch] +on: workflow_call jobs: depCheck: name: OWASP Dependency Check runs-on: ubuntu-latest - steps: - uses: actions/checkout@v4 - name: Set up JDK 21 diff --git a/.github/workflows/check.license.yml b/.github/workflows/check.license.yml index d7d875715..5163bb7be 100644 --- a/.github/workflows/check.license.yml +++ b/.github/workflows/check.license.yml @@ -1,12 +1,11 @@ -name: License header check +name: check_license -on: [pull_request, workflow_dispatch] +on: workflow_call jobs: depCheck: name: License header check runs-on: ubuntu-latest - steps: - uses: actions/checkout@v4 with: diff --git a/.github/workflows/test.coverage.yml b/.github/workflows/test.coverage.yml index e946cfa4b..a9911b191 100644 --- a/.github/workflows/test.coverage.yml +++ b/.github/workflows/test.coverage.yml @@ -1,6 +1,6 @@ name: Tests -on: [pull_request, workflow_dispatch] +on: workflow_call jobs: coverage: diff --git a/.github/workflows/workflow.pull_request.yml b/.github/workflows/workflow.pull_request.yml new file mode 100644 index 000000000..53809aaf1 --- /dev/null +++ b/.github/workflows/workflow.pull_request.yml @@ -0,0 +1,36 @@ +name: Pull request CI +on: [pull_request] + +jobs: + pre_build: + name: Pre-build checks + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Check code style + uses: ./.github/workflows/check.codestyle.yml + - name: License header check + uses: ./.github/workflows/check.license.yml + - name: OWASP Dependency Check + uses: ./.github/workflows/check.dependency.yml + build: + name: Build modules + needs: pre_build + runs-on: ubuntu-latest + steps: + - name: Build modules + uses: ./.github/workflows/build.modules.yml + test: + name: Tests + needs: build + runs-on: ubuntu-latest + steps: + - name: Tests + uses: ./.github/workflows/test.coverage.yml + post_build: + name: Documentation + needs: test + runs-on: ubuntu-latest + steps: + - name: Build documentation + uses: ./.github/workflows/build.docs.yml \ No newline at end of file diff --git a/hartshorn-launchpad/src/main/java/org/dockbox/hartshorn/launchpad/environment/ApplicationEnvironment.java b/hartshorn-launchpad/src/main/java/org/dockbox/hartshorn/launchpad/environment/ApplicationEnvironment.java index 2296c937d..c23942193 100644 --- a/hartshorn-launchpad/src/main/java/org/dockbox/hartshorn/launchpad/environment/ApplicationEnvironment.java +++ b/hartshorn-launchpad/src/main/java/org/dockbox/hartshorn/launchpad/environment/ApplicationEnvironment.java @@ -22,6 +22,7 @@ import org.dockbox.hartshorn.inject.InjectorEnvironment; import org.dockbox.hartshorn.inject.component.ComponentRegistry; import org.dockbox.hartshorn.launchpad.ApplicationContext; +import org.dockbox.hartshorn.launchpad.HartshornApplication; import org.dockbox.hartshorn.launchpad.context.ApplicationContextCarrier; /**