Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,45 @@ on:
workflow_call:

jobs:
checkstyle:
name: Checkstyle
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Setup Java 21 LTS
uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'temurin'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Checkstyle
run: ./gradlew checkStyleMain checkstyleTest checkstyleIntTest

- name: Collect Artifacts
if: always()
run: |
mkdir -p artifacts
cp -r ./build/reports ./artifacts

- name: Upload Artifacts
uses: actions/upload-artifact@v4
if: always()
with:
name: 'Checkstyle Reports'
path: ./artifacts/**
compression-level: 9

- name: Temporary Artifacts Cleanup
run: rm -rf ./artifacts

unit-tests:
name: Unit Tests
needs: [ checkstyle ]
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
Expand Down Expand Up @@ -44,6 +81,7 @@ jobs:

component-tests:
name: Component Tests
needs: [ checkstyle ]
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
Expand Down Expand Up @@ -83,6 +121,7 @@ jobs:

integration_tests:
name: Integration Tests
needs: [ checkstyle ]
permissions:
contents: read
runs-on: ubuntu-latest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,16 @@ public class PemFormatterTest {
@Test
public void When_CertHasExtraWhitespace_Expect_ItIsTrimmed() {

// this warning is suppressed as the extra whitespace (including trailing whitespace) is intentional
@SuppressWarnings("com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSingleLineCheck")
//The extra whitespace (including trailing whitespace) is intentional for this test and has been suppressed with `\s`
final String withWhitespace = """
-----BEGIN CERTIFICATE-----
MIIFXzCCA0egAwIBAgIJALRbCSor9bEbMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV
MIIFXzCCA0egAwIBAgIJALRbCSor9bEbMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV \s
\s
\s
W/JNIRmhLoeFNGNh8HvhI2PwOCsFiqT1rrCaUtusTyH0Ggs=
-----END CERTIFICATE-----
""";
\s
-----END CERTIFICATE----- \s
\s""";

final String trimmed = """
-----BEGIN CERTIFICATE-----
Expand Down