Skip to content

Commit

Permalink
Merge pull request #26 from nib-health-funds/actions
Browse files Browse the repository at this point in the history
Use GitHub Actions for running tests, drop travis-ci
  • Loading branch information
angelling11 committed Dec 30, 2020
2 parents c22b7f4 + d51e61e commit d713378
Show file tree
Hide file tree
Showing 6 changed files with 360 additions and 629 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: ci

on:
- push

env:
NODE_VERSION: 10.x

jobs:
build_and_test:
name: Lint and test
runs-on: ubuntu-latest
env:
REPO_NAMES: test-repo
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: ${{ env.NODE_VERSION }}
- uses: actions/cache@v2
id: cache
with:
path: ~/.npm
key: npm-cache-${{ hashFiles('package-lock.json') }}
- run: |
npm install
npm run lint
npm run prettier:check
npm run test
7 changes: 0 additions & 7 deletions .travis.yml

This file was deleted.

40 changes: 23 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Note that [ECR Lifecycle Policies](http://docs.aws.amazon.com/AmazonECR/latest/userguide/LifecyclePolicies.html) may be a better fit for you use case.

[![Build Status](https://travis-ci.org/nib-health-funds/robin.svg?branch=master)](https://travis-ci.org/nib-health-funds/robin)
[![cicd](https://github.com/nib-health-funds/robin/workflows/ci/badge.svg?branch=master)](https://github.com/nib-health-funds/robin/actions?query=workflow%3Aci)
[![Dependencies](https://david-dm.org/nib-health-funds/robin.svg)](https://david-dm.org/nib-health-funds/robin)

Batman's very capable side kick - deletes old ECR images.
Expand Down Expand Up @@ -31,29 +31,35 @@ through all pages of images, we suggest you simply run the lambda multiple times

1. Lint the function

```
$ npm run lint
```
```
$ npm run lint
```

5. Test the function
1. Run Prettier

```
$ npm test
```
```
$ npm run prettier:check
```

6. Deploy the function
1. Test the function

```
# Describe REPO_NAMES at deploy time
```
$ npm test
```

$ REPO_NAMES="test_repo,test_repo_1,test_repo_2" AWS_ACCOUNT_ID=1234567890 npm run deploy
```
1. Deploy the function

7. Tail cloudwatch logs
```
# Describe REPO_NAMES at deploy time
```
$ npm run tail-logs
```
$ REPO_NAMES="test_repo,test_repo_1,test_repo_2" AWS_ACCOUNT_ID=1234567890 npm run deploy
```

1. Tail cloudwatch logs

```
$ npm run tail-logs
```


## TODO
Expand Down
4 changes: 2 additions & 2 deletions handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,8 @@ module.exports.cleanupImages = (event, context, callback) => {

return Promise.resolve(reportText);
})
.then((text) =>
postToSlack(text) // Post results to Slack
.then(
(text) => postToSlack(text) // Post results to Slack
)
.then(() => {
callback(null, { message: "robin executed successfully!", event });
Expand Down
Loading

0 comments on commit d713378

Please sign in to comment.