Skip to content

Commit

Permalink
Target Java 17 and Use GitHub Actions (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
aws-sde authored Feb 28, 2024
1 parent ceb7bf2 commit e0a153b
Show file tree
Hide file tree
Showing 23 changed files with 128 additions and 74 deletions.
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md → .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Code of Conduct
# Code of Conduct
This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
[email protected] with any additional questions or comments.
File renamed without changes.
2 changes: 2 additions & 0 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Security Issue Notifications
If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public GitHub issue.
23 changes: 23 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
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"

- 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 -r ${{ github.workspace }}/requirements.txt

- 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
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,16 @@ Usage

The CloudFormation CLI (cfn) allows you to author your own resource providers that can be used by CloudFormation.

Refer to the documentation for the [CloudFormation CLI](https://github.com/aws-cloudformation/aws-cloudformation-rpdk) for usage instructions.
Refer to the documentation for the [CloudFormation CLI](https://github.com/aws-cloudformation/cloudformation-cli) for usage instructions.


Development
-----------

First, you will need to install the [CloudFormation CLI](https://github.com/aws-cloudformation/aws-cloudformation-rpdk), as it is a required dependency:
First, you will need to install the [CloudFormation CLI](https://github.com/aws-cloudformation/cloudformation-cli), as it is a required dependency:

```shell
pip3 install cloudformation-cli
pip3 install cloudformation-cli-java-plugin
pip3 install -U -r requirements.txt
```

Linting and running unit tests is done via [pre-commit](https://pre-commit.com/), and so is performed automatically on commit. The continuous integration also runs these checks.
Expand All @@ -37,7 +36,7 @@ mvn verify

## Security

See [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more information.
See [CONTRIBUTING](.github/SECURITY.md) for more information.

## License

Expand Down
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.

3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
cloudformation-cli
cloudformation-cli-java-plugin
setuptools

0 comments on commit e0a153b

Please sign in to comment.