Skip to content

Commit

Permalink
Add test:ci script to rest of templates (#473)
Browse files Browse the repository at this point in the history
  • Loading branch information
72636c authored Jul 13, 2021
1 parent 37503f5 commit 5b00ffa
Show file tree
Hide file tree
Showing 12 changed files with 33 additions and 32 deletions.
5 changes: 0 additions & 5 deletions .changeset/afraid-humans-design.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/calm-seahorses-stare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'skuba': patch
---

**template:** Add `test:ci` script
5 changes: 0 additions & 5 deletions .changeset/quiet-actors-live.md

This file was deleted.

6 changes: 3 additions & 3 deletions template/greeter/.buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ steps:
- <<: *prod
label: 🧪 Test & Lint
commands:
- echo '+++ yarn test'
- yarn test
- echo '+++ yarn lint'
- echo '+++ yarn test:ci'
- yarn test:ci
- echo '--- yarn lint'
- yarn lint
plugins:
- *aws-sm
Expand Down
3 changes: 2 additions & 1 deletion template/greeter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"lint": "skuba lint",
"start": "ENVIRONMENT=local skuba start",
"start:debug": "yarn start --inspect-brk",
"test": "skuba test --coverage",
"test": "skuba test",
"test:ci": "skuba test --coverage",
"test:watch": "skuba test --watch"
}
}
22 changes: 11 additions & 11 deletions template/lambda-sqs-worker-cdk/.buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ prod-agent: &prod-agent
agents:
queue: <%- prodBuildkiteQueueName %>

plugins: &plugins #alias for shared plugins
plugins: &plugins
seek-oss/aws-sm#v2.3.1:
env:
NPM_READ_TOKEN: 'arn:aws:secretsmanager:ap-southeast-2:987872074697:secret:npm/npm-read-token'
NPM_READ_TOKEN: arn:aws:secretsmanager:ap-southeast-2:987872074697:secret:npm/npm-read-token
docker#v3.8.0:
volumes:
- /workdir/node_modules
Expand All @@ -24,39 +24,39 @@ plugins: &plugins #alias for shared plugins
- yarn.lock

steps:
- label: ':yarn: :eslint: Lint and :jest: unit test'
- label: ':yarn: :eslint: Lint and :jest: unit test'
<<: *dev-agent
plugins:
<<: *plugins
key: test
command:
- echo "--- Running yarn lint"
- yarn lint
- echo "--- Running yarn test :jest:"
commands:
- echo "+++ yarn test:ci"
- yarn test
- echo "--- yarn lint"
- yarn lint

- label: 'Build & CDK Deploy Staging :shipit:'
- label: 'Build & CDK Deploy Staging :shipit:'
<<: *dev-agent
plugins:
<<: *plugins
depends_on:
- test
command:
commands:
- echo "--- Building code"
- yarn build
- echo "--- Running CDK deploy to staging"
- yarn deploy:dev
concurrency: 1
concurrency_group: '<%- repoName %>/deploy/dev'

- label: 'Build & CDK Deploy Production :shipit:'
- label: 'Build & CDK Deploy Production :shipit:'
branches: 'master'
<<: *prod-agent
plugins:
<<: *plugins
depends_on:
- test
command:
commands:
- echo "--- Building code"
- yarn build
- echo "--- Running CDK deploy to production"
Expand Down
2 changes: 2 additions & 0 deletions template/lambda-sqs-worker-cdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
"format": "skuba format",
"lint": "skuba lint",
"test": "skuba test",
"test:ci": "skuba test --coverage",
"test:watch": "skuba test --watch",
"package": "yarn --prod --modules-folder ./lib/node_modules",
"deploy:dev": "cdk deploy appStack --require-approval never --context stage=dev",
"deploy:prod": "cdk deploy appStack --require-approval never --context stage=prod"
Expand Down
4 changes: 2 additions & 2 deletions template/lambda-sqs-worker/.buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ steps:
- <<: *prod
label: 🧪 Test & Lint
commands:
- echo '+++ yarn test'
- yarn test
- echo '+++ yarn test:ci'
- yarn test:ci
- echo '+++ yarn lint'
- yarn lint
plugins:
Expand Down
3 changes: 2 additions & 1 deletion template/lambda-sqs-worker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
"smoke": "serverless invoke --data '{}' --function Worker",
"start": "ENVIRONMENT=local skuba start --port <%- port %>",
"start:debug": "yarn start --inspect-brk",
"test": "skuba test --coverage",
"test": "skuba test",
"test:ci": "skuba test --coverage",
"test:watch": "skuba test --watch"
}
}
6 changes: 3 additions & 3 deletions template/oss-npm-package/.github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ jobs:
- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Test
run: yarn test:ci

- name: Lint
run: yarn lint

- name: Test
run: yarn test
3 changes: 2 additions & 1 deletion template/oss-npm-package/_package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"format": "skuba format",
"lint": "skuba lint",
"release": "yarn build && skuba release",
"test": "skuba test --coverage",
"test": "skuba test",
"test:ci": "skuba test --coverage",
"test:watch": "skuba test --watch"
},
"config": {
Expand Down
1 change: 1 addition & 0 deletions template/private-npm-package/_package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"lint": "skuba lint",
"release": "yarn build && skuba release",
"test": "skuba test --coverage",
"test:ci": "yarn -s test",
"test:watch": "skuba test --watch"
},
"config": {
Expand Down

0 comments on commit 5b00ffa

Please sign in to comment.