Skip to content

Commit 13e518d

Browse files
Change to use cdk in workflow
Co-authored-by: Jorge <Jorge.Azevedo@guardian.co.uk>
1 parent e812aa7 commit 13e518d

2 files changed

Lines changed: 53 additions & 9 deletions

File tree

.github/workflows/fake-breaking-news.yml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name: Fake breaking news lambda
33
on:
44
push:
55
paths:
6+
- cdk/**
67
- fakebreakingnewslambda/**
78
- common/**
89
- commoneventconsumer/**
@@ -37,6 +38,22 @@ jobs:
3738
- name: Copy jar to root
3839
run: cp fakebreakingnewslambda/target/scala-*/fakebreakingnewslambda.jar .
3940

41+
- run: corepack enable
42+
43+
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 #v6.2.0
44+
with:
45+
cache: yarn
46+
cache-dependency-path: cdk/yarn.lock
47+
node-version-file: .nvmrc
48+
49+
- name: CDK synth
50+
run: |
51+
cd cdk
52+
yarn install --immutable
53+
yarn lint
54+
yarn test
55+
yarn synth
56+
4057
- name: Upload to riff-raff
4158
uses: guardian/actions-riff-raff@v4
4259
with:
@@ -47,6 +64,5 @@ jobs:
4764
configPath: fakebreakingnewslambda/riff-raff.yaml
4865
contentDirectories: |
4966
fakebreakingnewslambda:
50-
- fakebreakingnewslambda.jar
51-
fakebreakingnewslambda-cfn:
52-
- fakebreakingnewslambda/fakebreakingnewslambda-cfn.yaml
67+
- cdk/cdk.out/FakeBreakingNewsLambda-CODE.template.json
68+
- cdk/cdk.out/FakeBreakingNewsLambda-PROD.template.json

cdk/lib/__snapshots__/fakebreakingnewslambda.test.ts.snap

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@ exports[`The FakeBreakingNewsLambda stack matches the snapshot for CODE 1`] = `
101101
},
102102
],
103103
"Tags": [
104+
{
105+
"Key": "App",
106+
"Value": "fakebreakingnews",
107+
},
104108
{
105109
"Key": "gu:cdk:version",
106110
"Value": "TEST",
@@ -160,9 +164,7 @@ exports[`The FakeBreakingNewsLambda stack matches the snapshot for CODE 1`] = `
160164
"Tags": [
161165
{
162166
"Key": "App",
163-
"Value": {
164-
"Ref": "App",
165-
},
167+
"Value": "fakebreakingnews",
166168
},
167169
{
168170
"Key": "gu:cdk:version",
@@ -209,6 +211,10 @@ exports[`The FakeBreakingNewsLambda stack matches the snapshot for CODE 1`] = `
209211
"Properties": {
210212
"ScheduleExpression": "cron(5 * * * ? *)",
211213
"Tags": [
214+
{
215+
"Key": "App",
216+
"Value": "fakebreakingnews",
217+
},
212218
{
213219
"Key": "gu:cdk:version",
214220
"Value": "TEST",
@@ -269,6 +275,10 @@ exports[`The FakeBreakingNewsLambda stack matches the snapshot for CODE 1`] = `
269275
"Period": 7200,
270276
"Statistic": "Sum",
271277
"Tags": [
278+
{
279+
"Key": "App",
280+
"Value": "fakebreakingnews",
281+
},
272282
{
273283
"Key": "gu:cdk:version",
274284
"Value": "TEST",
@@ -321,6 +331,10 @@ exports[`The FakeBreakingNewsLambda stack matches the snapshot for CODE 1`] = `
321331
"Period": 7200,
322332
"Statistic": "Sum",
323333
"Tags": [
334+
{
335+
"Key": "App",
336+
"Value": "fakebreakingnews",
337+
},
324338
{
325339
"Key": "gu:cdk:version",
326340
"Value": "TEST",
@@ -448,6 +462,10 @@ exports[`The FakeBreakingNewsLambda stack matches the snapshot for PROD 1`] = `
448462
},
449463
],
450464
"Tags": [
465+
{
466+
"Key": "App",
467+
"Value": "fakebreakingnews",
468+
},
451469
{
452470
"Key": "gu:cdk:version",
453471
"Value": "TEST",
@@ -507,9 +525,7 @@ exports[`The FakeBreakingNewsLambda stack matches the snapshot for PROD 1`] = `
507525
"Tags": [
508526
{
509527
"Key": "App",
510-
"Value": {
511-
"Ref": "App",
512-
},
528+
"Value": "fakebreakingnews",
513529
},
514530
{
515531
"Key": "gu:cdk:version",
@@ -556,6 +572,10 @@ exports[`The FakeBreakingNewsLambda stack matches the snapshot for PROD 1`] = `
556572
"Properties": {
557573
"ScheduleExpression": "cron(5 * * * ? *)",
558574
"Tags": [
575+
{
576+
"Key": "App",
577+
"Value": "fakebreakingnews",
578+
},
559579
{
560580
"Key": "gu:cdk:version",
561581
"Value": "TEST",
@@ -616,6 +636,10 @@ exports[`The FakeBreakingNewsLambda stack matches the snapshot for PROD 1`] = `
616636
"Period": 7200,
617637
"Statistic": "Sum",
618638
"Tags": [
639+
{
640+
"Key": "App",
641+
"Value": "fakebreakingnews",
642+
},
619643
{
620644
"Key": "gu:cdk:version",
621645
"Value": "TEST",
@@ -668,6 +692,10 @@ exports[`The FakeBreakingNewsLambda stack matches the snapshot for PROD 1`] = `
668692
"Period": 7200,
669693
"Statistic": "Sum",
670694
"Tags": [
695+
{
696+
"Key": "App",
697+
"Value": "fakebreakingnews",
698+
},
671699
{
672700
"Key": "gu:cdk:version",
673701
"Value": "TEST",

0 commit comments

Comments
 (0)