From 7db78395c4d7080840024673ebf5366d8a2497ec Mon Sep 17 00:00:00 2001 From: Roberto Tyley Date: Mon, 20 May 2024 11:16:36 +0100 Subject: [PATCH 1/2] Add Java version - see guardian/gha-scala-library-release-workflow#36 --- .tool-versions | 1 + 1 file changed, 1 insertion(+) create mode 100644 .tool-versions diff --git a/.tool-versions b/.tool-versions new file mode 100644 index 0000000..cff4b12 --- /dev/null +++ b/.tool-versions @@ -0,0 +1 @@ +java corretto-21.0.3.9.1 From 5d991cc49aafc5227e1416804987a53e0292fbea Mon Sep 17 00:00:00 2001 From: Roberto Tyley Date: Fri, 24 May 2024 15:55:22 +0100 Subject: [PATCH 2/2] Update Lambda runtime and CI to Java 21 As suggested in https://github.com/guardian/anghammarad/pull/209#discussion_r1613508588, we want the Lambda runtime to match the Java version used by developers. I've also updated CI to use Java 21. Ideally, we wouldn't have to do this separately anymore, as setup-java has added partial support for asdf's .tool-versions file with https://github.com/actions/setup-java/pull/606, but unfortunately https://github.com/actions/setup-java/issues/615 means that it won't work with Corretto version numbers. --- .github/workflows/ci.yml | 6 +++--- cloudformation/cfn.yaml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bfa2c05..bb82b15 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,10 +24,10 @@ jobs: # Configuring caching is also recommended. # See https://github.com/actions/setup-java - - name: Setup Java 11 - uses: actions/setup-java@v3 + - name: Setup Java + uses: actions/setup-java@v4 with: - java-version: '11' + java-version: '21' distribution: 'corretto' cache: 'sbt' diff --git a/cloudformation/cfn.yaml b/cloudformation/cfn.yaml index 3c11348..04bdecf 100644 --- a/cloudformation/cfn.yaml +++ b/cloudformation/cfn.yaml @@ -61,7 +61,7 @@ Resources: - s3:GetObject Resource: !Sub arn:aws:s3:::${ConfigBucket}/* Handler: com.gu.anghammarad.Lambda::handleRequest - Runtime: java11 + Runtime: java21 MemorySize: 512 Timeout: 30 CodeUri: