Skip to content

Commit

Permalink
#597: Move workflows into ci-build.yml (#605)
Browse files Browse the repository at this point in the history
Co-authored-by: Christoph Kuhnke <[email protected]>
  • Loading branch information
kaklakariada and ckunki authored Nov 22, 2024
1 parent 70b4540 commit 8b88d4b
Show file tree
Hide file tree
Showing 37 changed files with 588 additions and 208 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/broken_links_checker.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

89 changes: 86 additions & 3 deletions .github/workflows/ci-build.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/test_on_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
pull_request:

jobs:
test:
test-on-windows:
runs-on: windows-latest
permissions:
contents: read
Expand Down
18 changes: 16 additions & 2 deletions .project-keeper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ version:
excludes:
# PK can't use itself as a Maven plugin
- regex: "W-PK-CORE-151: Pom file .* contains no reference to project-keeper-maven-plugin."
# Build with Java 21 fails due to missing JavaDoc comments, see https://github.com/exasol/project-keeper/issues/596
- "E-PK-CORE-17: Missing required file: '.github/workflows/ci-build-next-java.yml'"
# No configuration necessary for aggregator POM
- "E-PK-CORE-103: Missing parent declaration in 'pom.xml'"
- "E-PK-CORE-17: Missing required file: 'pk_generated_parent.pom'"
Expand All @@ -89,6 +87,7 @@ build:
- name: "ci-build.yml"
stepCustomizations:
- action: INSERT_AFTER
job: build-and-test
stepId: setup-java
content:
name: Set up Go
Expand All @@ -98,12 +97,14 @@ build:
go-version: "1.22"
cache-dependency-path: .project-keeper.yml
- action: INSERT_AFTER
job: build-and-test
stepId: setup-go
content:
name: Install Go tools
id: install-go-tools
run: go install github.com/google/[email protected]
- action: REPLACE
job: build-and-test
stepId: build-pk-verify
content:
name: Run tests and build with Maven
Expand All @@ -115,12 +116,14 @@ build:
env:
GITHUB_TOKEN: ${{ github.token }} # Required for integration tests
- action: INSERT_AFTER
job: build-and-test
stepId: sonar-analysis
content:
name: Run project-keeper itself
id: build-pk-verify
run: mvn --batch-mode com.exasol:project-keeper-maven-plugin:verify --projects .
- action: INSERT_AFTER
job: build-and-test
stepId: build-pk-verify
content:
name: Verify that metrics.json was created
Expand All @@ -130,10 +133,21 @@ build:
ls -lh coverage-aggregator/target/metrics.json
cat coverage-aggregator/target/metrics.json
# Build with Java 21 fails due to missing JavaDoc comments, see https://github.com/exasol/project-keeper/issues/596
- action: REPLACE
job: next-java-compatibility
stepId: build-next-java
content:
name: Run tests and build with Maven 21
id: build-next-java
# Only run tests as javadoc has warnings with Java 21
run: mvn --batch-mode clean test -DtrimStackTrace=false -Djava.version=21

# [itest->dsn~customize-build-process.dependency-check~0]
- name: "dependencies_check.yml"
stepCustomizations:
- action: INSERT_AFTER
job: report_security_issues
stepId: setup-jdks
content:
name: Install Project Keeper
Expand Down
2 changes: 1 addition & 1 deletion doc/changes/changelog.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 11 additions & 10 deletions doc/changes/changes_4.4.1.md → doc/changes/changes_4.5.0.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# Project Keeper 4.4.1, released 2024-??-??
# Project Keeper 4.5.0, released 2024-11-22

Code name: Fix java customization

## Summary

This release allows customization of the java version in `actions/setup-java` steps.
This release allows customization of the java version in `actions/setup-java` steps. It also migrates generated workflows `broken_links_checker.yml` and `ci-build-next-java.yml` into `ci-build.yml`. This allows simplifying branch protection rules. Now only `build` is required, you can remove `next-java-compatibility` and `linkChecker`.

## Features

* #602: Fixed customization of java version in `actions/setup-java`
* #597: Migrate workflows `broken_links_checker.yml` and `ci-build-next-java.yml` into `ci-build.yml`

## Bugfixes

Expand Down Expand Up @@ -41,16 +42,16 @@ This release allows customization of the java version in `actions/setup-java` st

#### Compile Dependency Updates

* Updated `com.exasol:project-keeper-shared-model-classes:4.4.0` to `4.4.1`
* Updated `com.exasol:project-keeper-shared-model-classes:4.4.0` to `4.5.0`

#### Runtime Dependency Updates

* Updated `com.exasol:project-keeper-java-project-crawler:4.4.0` to `4.4.1`
* Updated `com.exasol:project-keeper-java-project-crawler:4.4.0` to `4.5.0`

#### Test Dependency Updates

* Updated `com.exasol:maven-project-version-getter:1.2.0` to `1.2.1`
* Updated `com.exasol:project-keeper-shared-test-setup:4.4.0` to `4.4.1`
* Updated `com.exasol:project-keeper-shared-test-setup:4.4.0` to `4.5.0`
* Updated `nl.jqno.equalsverifier:equalsverifier:3.17.1` to `3.17.3`

#### Plugin Dependency Updates
Expand All @@ -67,12 +68,12 @@ This release allows customization of the java version in `actions/setup-java` st

#### Compile Dependency Updates

* Updated `com.exasol:project-keeper-core:4.4.0` to `4.4.1`
* Updated `com.exasol:project-keeper-core:4.4.0` to `4.5.0`

#### Test Dependency Updates

* Updated `com.exasol:maven-project-version-getter:1.2.0` to `1.2.1`
* Updated `com.exasol:project-keeper-shared-test-setup:4.4.0` to `4.4.1`
* Updated `com.exasol:project-keeper-shared-test-setup:4.4.0` to `4.5.0`

#### Plugin Dependency Updates

Expand All @@ -88,7 +89,7 @@ This release allows customization of the java version in `actions/setup-java` st

#### Compile Dependency Updates

* Updated `com.exasol:project-keeper-core:4.4.0` to `4.4.1`
* Updated `com.exasol:project-keeper-core:4.4.0` to `4.5.0`

#### Test Dependency Updates

Expand All @@ -110,7 +111,7 @@ This release allows customization of the java version in `actions/setup-java` st

#### Compile Dependency Updates

* Updated `com.exasol:project-keeper-shared-model-classes:4.4.0` to `4.4.1`
* Updated `com.exasol:project-keeper-shared-model-classes:4.4.0` to `4.5.0`

#### Test Dependency Updates

Expand All @@ -132,7 +133,7 @@ This release allows customization of the java version in `actions/setup-java` st

#### Compile Dependency Updates

* Updated `com.exasol:project-keeper-shared-model-classes:4.4.0` to `4.4.1`
* Updated `com.exasol:project-keeper-shared-model-classes:4.4.0` to `4.5.0`

#### Plugin Dependency Updates

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public class TestMavenModel extends Model {
public static final String PROJECT_VERSION = "0.1.0";
public static final String PROJECT_GROUP_ID = "com.example";

@SuppressWarnings("this-escape") // Required by 3rd party parent class
public TestMavenModel() {
this.setBuild(new Build());
this.setVersion(PROJECT_VERSION);
Expand Down
2 changes: 1 addition & 1 deletion parent-pom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</repository>
</distributionManagement>
<properties>
<revision>4.4.1</revision>
<revision>4.5.0</revision>
<!-- Integration test ProjectKeeperMojoIT starts a Maven build which requires Java 17. -->
<java.version>17</java.version>
<maven.version>3.9.9</maven.version>
Expand Down
2 changes: 1 addition & 1 deletion project-keeper/error_code_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ error-tags:
PK-CORE:
packages:
- com.exasol.projectkeeper
highest-index: 207
highest-index: 208
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ private StepCustomization convertStep(final RawStepCustomization step) {
.mitigation("Add content to the step customization.").toString());
}
return StepCustomization.builder() //
.jobId(step.job) //
.type(step.action) //
.stepId(step.stepId) //
.step(WorkflowStep.createStep(step.content)) //
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,8 @@ public RawStepCustomization() {
// Required for specifying Javadoc
}

/** ID of the job to customize. */
public String job;
/** Customization type (insert/replace). */
public StepCustomization.Type action;
/** ID of the step to replace or after which to insert. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.net.URI;

import javax.xml.XMLConstants;
import javax.xml.parsers.*;
Expand Down Expand Up @@ -104,7 +104,7 @@ public String getLatestVersion()
factory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, "");
factory.setAttribute(XMLConstants.ACCESS_EXTERNAL_SCHEMA, "");
final DocumentBuilder db = factory.newDocumentBuilder();
try (InputStream stream = new URL(this.url).openStream()) {
try (InputStream stream = URI.create(this.url).toURL().openStream()) {
return getLatestVersion(db.parse(stream));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public class DeletedFilesValidator implements Validator {
Path.of(GITHUB_WORKFLOWS, "release_droid_release_on_maven_central.yml"), RELEASE_DROID_WORKFLOW_WARNING,
Path.of(GITHUB_WORKFLOWS, "release_droid_upload_github_release_assets.yml"), RELEASE_DROID_WORKFLOW_WARNING,
Path.of(GITHUB_WORKFLOWS, "release_droid_prepare_original_checksum.yml"), RELEASE_DROID_WORKFLOW_WARNING,
Path.of(GITHUB_WORKFLOWS, "ci-build-next-java.yml"), "Next Java build is now included in ci-build.yml",
Path.of("release_config.yml"), "Release-droid configuration is replaced by release.yml");
private final Path projectDirectory;

Expand Down
Loading

0 comments on commit 8b88d4b

Please sign in to comment.