Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added workflows and amended pom #6

Closed
wants to merge 9 commits into from
Closed
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
54 changes: 54 additions & 0 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: CD

on:
push:
branches:
- main

jobs:
release-please:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
outputs:
tag_name: ${{ steps.release.outputs.tag_name }}
release_created: ${{ steps.release.outputs.release_created }}
steps:
- uses: google-github-actions/release-please-action@v4
id: release
with:
release-type: maven

call-build-maven:
needs: release-please
name: build with Maven
uses: ./.github/workflows/maven_build.yaml

publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
needs:
- release-please
- call-build-maven
steps:
- name: checkout code
uses: actions/checkout@v4

- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'corretto'
cache: 'maven'

- name: Publish to GitHub Packages Apache Maven
if: ${{needs.release-please.outputs.release_created}}
run: mvn --batch-mode deploy
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}


17 changes: 17 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: CI

on:
pull_request:

jobs:
security:
name: Security
uses: ./.github/workflows/security.yaml
secrets: inherit

build-maven:
name: build with Maven
uses: ./.github/workflows/maven_build.yaml
needs: security


38 changes: 0 additions & 38 deletions .github/workflows/maven-publish.yml

This file was deleted.

18 changes: 18 additions & 0 deletions .github/workflows/maven_build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Maven Build

on:
workflow_call:

permissions:
contents: read

jobs:
build:
name: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- run: mvn -B package


38 changes: 38 additions & 0 deletions .github/workflows/security.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Security Scan

on:
workflow_call:
inputs:
severity-threshold:
description: "Severity threshold"
required: false
default: "high"
type: string
secrets:
SNYK_TOKEN:
description: "Snyk token"
required: true
schedule:
# Weekly on Monday at 00:00 UTC
- cron: 0 0 * * 1

permissions:
contents: read
packages: read

jobs:
scan:
name: scan
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v4
- uses: snyk/actions/setup@master
- uses: actions/setup-java@v4
with:
distribution: "corretto"
java-version: "11"
cache: maven
- run: snyk test --severity-threshold=${{ inputs.severity-threshold || 'high' }}
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
20 changes: 20 additions & 0 deletions .snyk
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities.
version: v1.25.0
# ignores vulnerabilities until expiry date; change duration by modifying expiry date
ignore:
SNYK-JAVA-DOM4J-174153:
- '*':
reason: None Given
expires: 2024-06-08T13:15:21.624Z
created: 2024-05-09T13:15:21.627Z
SNYK-JAVA-SOFTWAREAMAZONION-6153869:
- '*':
reason: None Given
expires: 2024-06-08T13:27:49.964Z
created: 2024-05-09T13:27:49.971Z
SNYK-JAVA-DOM4J-2812975:
- '*':
reason: None Given
expires: 2024-06-08T13:33:05.972Z
created: 2024-05-09T13:33:05.980Z
patch: {}
107 changes: 45 additions & 62 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<nexus.releases>https://nexus.olcs.dev-dvsacloud.uk/repository/maven-releases</nexus.releases>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.version>3.8.1</maven.compiler.version>
<active-support.version>2.0.1.7</active-support.version>
<active-support.version>2.0.1.10</active-support.version>
<axe-selenium-version>4.8.0</axe-selenium-version>
<!--suppress UnresolvedMavenProperty -->
<rules.scan>${rules}</rules.scan>
Expand All @@ -21,81 +21,64 @@
<mustache.version>0.9.11</mustache.version>
<slf4j.version>2.22.0</slf4j.version>
<slf4j-log4j12.version>2.22.0</slf4j-log4j12.version>
<github.url>https://maven.pkg.github.com/dvsa/vol-accessibility-lib</github.url>
<commons-beanutils.version>1.9.4</commons-beanutils.version>
<commons-collections.version>3.2.2</commons-collections.version>
<dom4j.version>1.6.1</dom4j.version>
<org.apache.commons.commons-text.version>1.10.0</org.apache.commons.commons-text.version>
<org.apache.commons.commons-compress.version>1.26.0</org.apache.commons.commons-compress.version>
<org.json.version>20180130</org.json.version>
<org.postgresql.version>42.3.9</org.postgresql.version>
<org.yaml.snakeyaml.version>1.31</org.yaml.snakeyaml.version>
<software.amazon.ion.version>1.0.3</software.amazon.ion.version>
<org.json.version>20231013</org.json.version>
</properties>

<repositories>
<repository>
<id>maven-releases</id>
<url>${nexus.releases}</url>
</repository>
</repositories>

<build>
<extensions>
<extension>
<groupId>org.springframework.build</groupId>
<artifactId>aws-maven</artifactId>
<version>5.0.0.RELEASE</version>
</extension>
</extensions>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven.compiler.version}</version>
<configuration>
<release>11</release>
</configuration>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>${slf4j.version}</version>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>${commons-beanutils.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>${slf4j-log4j12.version}</version>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>${commons-collections.version}</version>
</dependency>
<dependency>
<groupId>org.dvsa.testing.lib</groupId>
<artifactId>active-support</artifactId>
<version>${active-support.version}</version>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>${dom4j.version}</version>
</dependency>
<dependency>
<groupId>com.deque.html.axe-core</groupId>
<artifactId>selenium</artifactId>
<version>${axe-selenium-version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenenium-java</artifactId>
</exclusion>
</exclusions>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
<version>${org.apache.commons.commons-text.version}</version>
</dependency>
<dependency>
<groupId>com.github.spullara.mustache.java</groupId>
<artifactId>compiler</artifactId>
<version>${mustache.version}</version>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>${org.apache.commons.commons-compress.version}</version>
</dependency>
<dependency>
<groupId>com.deque.html.axe-core</groupId>
<artifactId>selenium</artifactId>
<version>${axe-selenium-version}</version>
<scope>compile</scope>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>${org.json.version}</version>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>${org.postgresql.version}</version>
</dependency>
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>${org.yaml.snakeyaml.version}</version>
</dependency>
<dependency>
<groupId>software.amazon.ion</groupId>
<artifactId>ion-java</artifactId>
<version>${software.amazon.ion.version}</version>
</dependency>
</dependencies>

<!-- Nexus Configuration -->
<distributionManagement>
<repository>
<id>maven-releases</id>
<url>${nexus.releases}</url>
</repository>
</distributionManagement>
</project>
Loading