Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 20 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,34 @@ on:
jobs:
build:
name: Build and test
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "14"
- run: yarn install --frozen-lockfile
- run: yarn lint
node-version: "18"
cache: "npm"
- run: npm ci
- run: npm run lint
- name: Setup DynamoDB Local
uses: rrainn/dynamodb-action@v2.0.0
uses: rrainn/dynamodb-action@v2.0.1
- name: Setup AWS credentials
run: |
mkdir ~/.aws
echo -e "[default]\naws_access_key_id=''\naws_secret_access_key=''" > ~/.aws/credentials
- name: Setup Serverless Offline & Run Tests
run: yarn ci
run: npm run ci
env:
SLACK_SIGNING_SECRET: dummy-signing-secret
SLACK_CLIENT_ID: dummy-client-id
SLACK_CLIENT_SECRET: dummy-client-secret
STATE_SECRET: dummy-state-secret
INSTALLATIONS_TABLE_NAME: installations
RESOURCES_TABLE_NAME: resources
ACCESS_TOKENS_TABLE_NAME: access-tokens
SERVERLESS_STAGE: test
API_GATEWAY_URL: http://localhost:3000
- name: Coveralls
uses: coverallsapp/github-action@v1.1.1
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
10 changes: 5 additions & 5 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ on:
jobs:
analyse:
name: Analyse
runs-on: ubuntu-20.04
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v3
with:
languages: javascript

- name: Autobuild
uses: github/codeql-action/autobuild@v1
uses: github/codeql-action/autobuild@v3

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v3
26 changes: 14 additions & 12 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,17 @@ on:
jobs:
deploy-dev:
name: Deploy to dev
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
environment: dev
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "14"
- run: yarn install --frozen-lockfile
node-version: "18"
cache: "npm"
- run: npm ci
- name: Serverless Deploy
run: yarn deploy --region eu-west-1 --stage dev
run: npm run deploy -- --region eu-west-1 --stage dev
env:
SLACK_SIGNING_SECRET: ${{ secrets.SLACK_SIGNING_SECRET }}
SLACK_CLIENT_ID: ${{ secrets.SLACK_CLIENT_ID }}
Expand All @@ -26,16 +27,17 @@ jobs:
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
deploy-prod:
name: Deploy to prod
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
environment: prod
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "14"
- run: yarn install --frozen-lockfile
node-version: "18"
cache: "npm"
- run: npm ci
- name: Serverless Deploy
run: yarn deploy --region eu-west-1 --stage prod
run: npm run deploy -- --region eu-west-1 --stage prod
env:
SLACK_SIGNING_SECRET: ${{ secrets.SLACK_SIGNING_SECRET }}
SLACK_CLIENT_ID: ${{ secrets.SLACK_CLIENT_ID }}
Expand Down
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18
15 changes: 7 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,39 +12,38 @@ Lockbot is written with local development in mind and you can create and test mo

### Pre-requisites

- [Node 14](http://nodejs.org/)
- [Yarn](https://yarnpkg.com/en/docs/install)
- [Node 18+](http://nodejs.org/)
- [Java Runtime Environment](http://www.oracle.com/technetwork/java/javase/downloads/index.html) (for local DynamoDB offline)

### Install dependencies

`yarn install`
`npm install`

### Setup local DynamoDB

The automated tests run against a local DynamoDB instance

#### One-time install

`yarn db:install`
`npm run db:install`

#### Start local DynamoDB

`yarn db:start`
`npm run db:start`

### Start Serverless Offline

The API tests run HTTP calls against emulated AWS Ξ» and API Gateway

`yarn dev`
`npm run dev`

### Run tests

`yarn test`
`npm test`

### Lint

`yarn lint`
`npm run lint`

## Deploy to AWS and Slack

Expand Down
11 changes: 11 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
module.exports = {
preset: "ts-jest",
testEnvironment: "node",
testTimeout: 10000,
transform: {
"^.+\\.tsx?$": [
"ts-jest",
{
tsconfig: {
allowJs: true,
},
},
],
},
};
Loading
Loading