test workflow

This commit is contained in:
neil 2022-10-18 12:36:26 +08:00
parent 54d21009f6
commit 7119323f73
3 changed files with 12 additions and 8 deletions

View file

@ -6,6 +6,7 @@ concurrency:
env: env:
TEA_SECRET: ${{ secrets.TEA_SECRET }} TEA_SECRET: ${{ secrets.TEA_SECRET }}
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
jobs: jobs:
deploy_sls: deploy_sls:

View file

@ -17,6 +17,9 @@ const serverlessConfiguration: AWS = {
AWS_NODEJS_CONNECTION_REUSE_ENABLED: '1', AWS_NODEJS_CONNECTION_REUSE_ENABLED: '1',
NODE_OPTIONS: '--enable-source-maps --stack-trace-limit=1000', NODE_OPTIONS: '--enable-source-maps --stack-trace-limit=1000',
}, },
iam: {
deploymentRole: `arn:aws:iam::${process.env.AWS_ACCOUNT_ID || '640264234305'}:role/CloudFormationExecutionRole`
}
}, },
// import the function via paths // import the function via paths
functions: { hello }, functions: { hello },

View file

@ -1,18 +1,18 @@
import schema from './schema'; // import schema from './schema';
import { handlerPath } from '@libs/handler-resolver'; import { handlerPath } from '@libs/handler-resolver';
export default { export default {
handler: `${handlerPath(__dirname)}/handler.main`, handler: `${handlerPath(__dirname)}/handler.main`,
events: [ events: [
{ {
http: { httpApi: {
method: 'post', method: 'post',
path: 'hello', path: '/hello',
request: { // request: {
schemas: { // schemas: {
'application/json': schema, // 'application/json': schema,
}, // },
}, // },
}, },
}, },
], ],