Skip to content

Commit

Permalink
Target Java 17 and use GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
aws-sde committed Feb 26, 2024
1 parent ceb7bf2 commit 4d0ff32
Show file tree
Hide file tree
Showing 18 changed files with 119 additions and 68 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
on:
workflow_call:

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
env:
PIP_DISABLE_PIP_VERSION_CHECK: 1

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"

- name: Run pre-commit
uses: pre-commit/[email protected]
with:
extra_args: --all-files
15 changes: 15 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: main

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

jobs:
lint:
uses: ./.github/workflows/lint.yaml

verify:
uses: ./.github/workflows/verify.yaml
59 changes: 59 additions & 0 deletions .github/workflows/verify.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
on:
workflow_call:

jobs:
lint:
name: Verify
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
package:
- aws-transfer-agreement
- aws-transfer-certificate
- aws-transfer-connector
- aws-transfer-profile
- aws-transfer-server
- aws-transfer-user
- aws-transfer-workflow
env:
AWS_DEFAULT_REGION: us-east-1
AWS_REGION: us-east-1
PIP_DISABLE_PIP_VERSION_CHECK: 1

defaults:
run:
working-directory: ${{ github.workspace }}/${{ matrix.package }}

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: temurin # This is the only distribution cached on GitHub Hosted Runners
java-version: "17"
cache: maven
cache-dependency-path: ${{ github.workspace }}/${{ matrix.package }}/pom.xml

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip

- name: Install CloudFormation CLI Java plugin
run: pip install -U cloudformation-cli-java-plugin

- name: Run mvn verify
run: mvn --batch-mode --no-transfer-progress clean verify

- name: Show RPDK log
if: always()
run: |
if [ -f 'rpdk.log' ]; then
cat 'rpdk.log'
else
echo 'No RPDK log found'
fi
2 changes: 1 addition & 1 deletion aws-transfer-agreement/.rpdk-config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"artifact_type": "RESOURCE",
"typeName": "AWS::Transfer::Agreement",
"language": "java",
"runtime": "java11",
"runtime": "java17",
"entrypoint": "software.amazon.transfer.agreement.HandlerWrapper::handleRequest",
"testEntrypoint": "software.amazon.transfer.agreement.HandlerWrapper::testEntrypoint",
"settings": {
Expand Down
4 changes: 2 additions & 2 deletions aws-transfer-agreement/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<packaging>jar</packaging>

<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<cfn.generate.args/>
Expand Down
2 changes: 1 addition & 1 deletion aws-transfer-certificate/.rpdk-config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"artifact_type": "RESOURCE",
"typeName": "AWS::Transfer::Certificate",
"language": "java",
"runtime": "java11",
"runtime": "java17",
"entrypoint": "software.amazon.transfer.certificate.HandlerWrapper::handleRequest",
"testEntrypoint": "software.amazon.transfer.certificate.HandlerWrapper::testEntrypoint",
"settings": {
Expand Down
4 changes: 2 additions & 2 deletions aws-transfer-certificate/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<packaging>jar</packaging>

<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<cfn.generate.args/>
Expand Down
2 changes: 1 addition & 1 deletion aws-transfer-connector/.rpdk-config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"artifact_type": "RESOURCE",
"typeName": "AWS::Transfer::Connector",
"language": "java",
"runtime": "java11",
"runtime": "java17",
"entrypoint": "software.amazon.transfer.connector.HandlerWrapper::handleRequest",
"testEntrypoint": "software.amazon.transfer.connector.HandlerWrapper::testEntrypoint",
"settings": {
Expand Down
4 changes: 2 additions & 2 deletions aws-transfer-connector/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<packaging>jar</packaging>

<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<cfn.generate.args/>
Expand Down
2 changes: 1 addition & 1 deletion aws-transfer-profile/.rpdk-config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"artifact_type": "RESOURCE",
"typeName": "AWS::Transfer::Profile",
"language": "java",
"runtime": "java11",
"runtime": "java17",
"entrypoint": "software.amazon.transfer.profile.HandlerWrapper::handleRequest",
"testEntrypoint": "software.amazon.transfer.profile.HandlerWrapper::testEntrypoint",
"settings": {
Expand Down
4 changes: 2 additions & 2 deletions aws-transfer-profile/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<packaging>jar</packaging>

<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<cfn.generate.args/>
Expand Down
2 changes: 1 addition & 1 deletion aws-transfer-server/.rpdk-config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"artifact_type": "RESOURCE",
"typeName": "AWS::Transfer::Server",
"language": "java",
"runtime": "java11",
"runtime": "java17",
"entrypoint": "software.amazon.transfer.server.HandlerWrapper::handleRequest",
"testEntrypoint": "software.amazon.transfer.server.HandlerWrapper::testEntrypoint",
"settings": {
Expand Down
4 changes: 2 additions & 2 deletions aws-transfer-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<packaging>jar</packaging>

<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<cfn.generate.args/>
Expand Down
2 changes: 1 addition & 1 deletion aws-transfer-user/.rpdk-config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"artifact_type": "RESOURCE",
"typeName": "AWS::Transfer::User",
"language": "java",
"runtime": "java11",
"runtime": "java17",
"entrypoint": "software.amazon.transfer.user.HandlerWrapper::handleRequest",
"testEntrypoint": "software.amazon.transfer.user.HandlerWrapper::testEntrypoint",
"settings": {
Expand Down
4 changes: 2 additions & 2 deletions aws-transfer-user/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<packaging>jar</packaging>

<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<cfn.generate.args/>
Expand Down
2 changes: 1 addition & 1 deletion aws-transfer-workflow/.rpdk-config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"artifact_type": "RESOURCE",
"typeName": "AWS::Transfer::Workflow",
"language": "java",
"runtime": "java11",
"runtime": "java17",
"entrypoint": "software.amazon.transfer.workflow.HandlerWrapper::handleRequest",
"testEntrypoint": "software.amazon.transfer.workflow.HandlerWrapper::testEntrypoint",
"settings": {
Expand Down
4 changes: 2 additions & 2 deletions aws-transfer-workflow/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<packaging>jar</packaging>

<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<cfn.generate.args/>
Expand Down
47 changes: 0 additions & 47 deletions buildspec.yml

This file was deleted.

0 comments on commit 4d0ff32

Please sign in to comment.