Skip to content

Commit

Permalink
Serverless upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
thenav56 committed Dec 20, 2022
1 parent e250fa1 commit 0b3c865
Show file tree
Hide file tree
Showing 5 changed files with 2,598 additions and 3,529 deletions.
26 changes: 18 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ name: CI
on:
pull_request:
push:
branches:
- develop

jobs:
test:
Expand All @@ -13,9 +15,11 @@ jobs:
- uses: actions/checkout@v2

- uses: actions/setup-node@v1
with:
node-version: 19.2
- uses: actions/setup-python@v2
with:
python-version: '3.x'
python-version: '3.10.8'

- name: Cache yarn
uses: actions/cache@v1
Expand All @@ -33,14 +37,20 @@ jobs:
restore-keys: |
${{ runner.os }}-pip-
- name: Run yarn install
run: yarn install

- name: pip install
run: pip install -r requirements.txt

- name: sls package
run: cp ./secrets/sample.json ./secrets/local.json && npx sls package

- name: Pytest
run: pytest
env:
AWS_DEFAULT_REGION: us-east-1
run: source ./.env.testing.sample && pytest -ra -v --durations=10

- name: Run yarn install
run: yarn install --frozen-lockfile

# - name: sls package
# env:
# AWS_DEFAULT_REGION: us-east-1
# AWS_ACCESS_KEY_ID: XXXXXXXXXXXXXXXXXXXX
# AWS_SECRET_ACCESS_KEY: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
# run: cp ./secrets/sample.json ./secrets/local.json && sls package --stage local
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@
"jsonwebtoken": "^8.5.1"
},
"devDependencies": {
"serverless": "^2.55.0",
"serverless-domain-manager": "^5.1.5",
"serverless": "^3.25.1",
"serverless-domain-manager": "^6.2.1",
"serverless-dynamodb-local": "^0.2.40",
"serverless-offline": "^8.0.0",
"serverless-offline": "^12.0.",
"serverless-plugin-include-dependencies": "^5.0.0",
"serverless-python-requirements": "^5.1.1",
"serverless-step-functions": "^3.0.0"
"serverless-python-requirements": "^6.0.0",
"serverless-step-functions": "^3.11.1"
}
}
8 changes: 4 additions & 4 deletions serverless.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
service: deep-util-services
frameworkVersion: "=2"
frameworkVersion: "=3"

provider:
name: aws
Expand Down Expand Up @@ -74,7 +74,7 @@ custom:
# ReadCapacityUnits: 1
# WriteCapacityUnits: 1
BillingMode: ${self:custom.dynamodbConfig.${self:provider.stage}.BillingMode, "PROVISIONED"}
ProvisionedThroughput: ${self:custom.dynamodbConfig.${self:provider.stage}.ProvisionedThroughput}
ProvisionedThroughput: ${self:custom.dynamodbConfig.${self:provider.stage}.ProvisionedThroughput, null}
dynamodb:
stages:
- ${self:provider.stage}
Expand Down Expand Up @@ -210,7 +210,7 @@ resources:
- AttributeName: uuid
KeyType: HASH
BillingMode: ${self:custom.dynamodbConfig.BillingMode}
ProvisionedThroughput: ${self:custom.dynamodbConfig.ProvisionedThroughput}
ProvisionedThroughput: ${self:custom.dynamodbConfig.ProvisionedThroughput, null}
TableName: ${self:custom.asyncJobTableName}
TimeToLiveSpecification:
AttributeName: ttl
Expand All @@ -226,7 +226,7 @@ resources:
- AttributeName: key
KeyType: HASH
BillingMode: ${self:custom.dynamodbConfig.BillingMode}
ProvisionedThroughput: ${self:custom.dynamodbConfig.ProvisionedThroughput}
ProvisionedThroughput: ${self:custom.dynamodbConfig.ProvisionedThroughput, null}
TableName: ${self:custom.sourceTableName}
GatewayResponseDefault4XX:
Type: "AWS::ApiGateway::GatewayResponse"
Expand Down
2 changes: 1 addition & 1 deletion src/functions/source_extract/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
'response': {
'authorsRaw': ['Nutrition Cluster', 'UNICEF'],
'country': 'South Sudan',
'date': '2023-05-28',
'date': '2020-05-28',
'sourceRaw': 'reliefweb',
'title': 'South Sudan: Nutrition Service Delivery In COVID-19 Context - Frequently asked question and suggested measures', # noqa:E501
'website': 'reliefweb.int',
Expand Down
Loading

0 comments on commit 0b3c865

Please sign in to comment.