Skip to content

Commit eb4c02b

Browse files
committed
setup codecov
1 parent 8133cca commit eb4c02b

File tree

13 files changed

+449
-911
lines changed

13 files changed

+449
-911
lines changed

.coveragerc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ branch = True
33

44
[report]
55
fail_under = 90
6+
show_missing = False

.eslintignore

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
build/*
2-
dist/*
3-
target/*
4-
.idea/*
5-
.vscode/*
6-
node_modules/*
7-
coverage/*
8-
python/*
1+
build/
2+
dist/
3+
target/
4+
.idea/
5+
.vscode/
6+
node_modules/
7+
coverage/
8+
python/

.github/workflows/cd.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
2-
name: Continuous Delivery (Release)
2+
# Continuous Delivery (Release)
3+
name: cd
34

45
on:
56
push:
@@ -8,7 +9,7 @@ on:
89

910
jobs:
1011
delivery-nodejs:
11-
name: Delivery to NPM
12+
name: Prepare for NPM
1213
runs-on: ubuntu-18.04
1314
steps:
1415
- uses: actions/checkout@v2
@@ -33,6 +34,7 @@ jobs:
3334
path: cfn-rpdk-${{ steps.tag_name.outputs.tag }}.tgz
3435

3536
delivery-python:
37+
name: Prepare for PyPI
3638
runs-on: ubuntu-18.04
3739
strategy:
3840
matrix:

.github/workflows/ci.yml

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
2-
name: Continuous Integration
2+
# Continous Integration
3+
name: ci
34

45
on:
56
pull_request:
@@ -10,8 +11,14 @@ on:
1011
- master
1112

1213
jobs:
13-
test:
14+
build:
1415
runs-on: ubuntu-18.04
16+
env:
17+
SAM_CLI_TELEMETRY: "0"
18+
AWS_REGION: "us-east-1"
19+
AWS_DEFAULT_REGION: "us-east-1"
20+
AWS_ACCESS_KEY_ID: "AKIAIOSFODNN7EXAMPLE"
21+
AWS_SECRET_ACCESS_KEY: "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
1522
steps:
1623
- uses: actions/checkout@v2
1724
- uses: actions/setup-python@v1
@@ -28,17 +35,23 @@ jobs:
2835
- name: Install Dependencies Node.js
2936
id: installation_nodejs
3037
run: |
31-
npm ci --optional
32-
- name: Run Tests
33-
id: testing
38+
npm ci --optional && npm run build
39+
- name: Run Unit Tests
40+
id: unit_testing
3441
run: |
3542
pre-commit run --all-files --verbose
43+
- name: Upload Coverage
44+
id: coverage
45+
run: |
46+
curl -s https://codecov.io/bash > codecov.sh
47+
bash codecov.sh -f coverage/py/coverage.xml -F unittests -n codecov-python
48+
bash codecov.sh -f coverage/ts/coverage-final.json -F unittests -n codecov-typescript
3649
- name: Upload Artifacts
3750
id: upload_artifacts
3851
uses: actions/upload-artifact@v1
3952
with:
40-
name: artifacts
41-
path: coverage
53+
name: coverage
54+
path: coverage/
4255
- name: Run Integration Tests
4356
id: integration_testing
4457
run: |
@@ -47,5 +60,6 @@ jobs:
4760
ls -la
4861
printf "AWS::Foo::Bar\n1\nn" | cfn init -vv
4962
ls -la
50-
npm install --optional
51-
npm run build
63+
cfn validate -vv && cfn generate -vv
64+
cfn submit --dry-run -vv
65+
sam local invoke --debug --event sam-tests/create.json TestEntrypoint

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,15 @@ repos:
6767
- id: pytest-local
6868
name: pytest-local
6969
description: Run pytest in the local virtualenv
70-
entry: pytest --cov-report term-missing --cov-report html:coverage/python --cov=rpdk.typescript --doctest-modules tests/
70+
entry: pytest --cov=rpdk.typescript tests/
7171
language: system
7272
# ignore all files, run on hard-coded modules instead
7373
pass_filenames: false
7474
always_run: true
7575
- id: jest-local
7676
name: jest-local
7777
description: Run jest in the local environment
78-
entry: npx jest --ci
78+
entry: npx jest --ci --verbose
7979
language: system
8080
# ignore all files, run on hard-coded modules instead
8181
pass_filenames: false

README.md

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
# DEVELOPER PREVIEW (COMMUNITY DRIVEN)
22

3-
We're excited to share our progress with adding new languages to the CloudFormation CLI!
4-
> This plugin is an early preview prepared by the community, and not ready for production use.
5-
6-
73
[![License MIT](https://img.shields.io/badge/license-MIT-brightgreen.svg)](https://opensource.org/licenses/MIT) [![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/eduardomourar/cloudformation-cli-typescript-plugin/issues) [![Project Status: WIP – Initial development](https://www.repostatus.org/badges/latest/wip.svg)](https://www.repostatus.org/#wip)
84

9-
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/eduardomourar/cloudformation-cli-typescript-plugin/Continuous%20Integration) ![GitHub release](https://img.shields.io/github/v/release/eduardomourar/cloudformation-cli-typescript-plugin?include_prereleases)
10-
[![nodejs version](https://img.shields.io/badge/dynamic/json?color=brightgreen&url=https://raw.githubusercontent.com/eduardomourar/cloudformation-cli-typescript-plugin/master/package.json&query=$.engines.node&label=nodejs)](https://nodejs.org/)
5+
We're excited to share our progress with adding new languages to the CloudFormation CLI!
6+
> This plugin is an early preview prepared by the community, and not ready for production use.
117
128
## AWS CloudFormation Resource Provider TypeScript Plugin
139

10+
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/eduardomourar/cloudformation-cli-typescript-plugin/ci) ![Codecov](https://img.shields.io/codecov/c/gh/eduardomourar/cloudformation-cli-typescript-plugin) ![GitHub release](https://img.shields.io/github/v/release/eduardomourar/cloudformation-cli-typescript-plugin?include_prereleases)
11+
[![Node.js version](https://img.shields.io/badge/dynamic/json?color=brightgreen&url=https://raw.githubusercontent.com/eduardomourar/cloudformation-cli-typescript-plugin/master/package.json&query=$.engines.node&label=nodejs)](https://nodejs.org/)
12+
1413
The CloudFormation CLI (cfn) allows you to author your own resource providers that can be used by CloudFormation.
1514

1615
This plugin library helps to provide TypeScript runtime bindings for the execution of your providers by CloudFormation.
@@ -57,26 +56,7 @@ with cross-platform Typescript packaging.
5756
>> y
5857
Initialized a new project in <>
5958
$ cfn submit --dry-run
60-
$ cat test.json
61-
{
62-
"credentials": {
63-
"accessKeyId": "",
64-
"secretAccessKey": "",
65-
"sessionToken": ""
66-
},
67-
"action": "CREATE",
68-
"request": {
69-
"clientRequestToken": "ecba020e-b2e6-4742-a7d0-8a06ae7c4b2b",
70-
"desiredResourceState": {
71-
"Title": "foo",
72-
"Description": "bar"
73-
},
74-
"previousResourceState": null,
75-
"logicalResourceIdentifier": null
76-
},
77-
"callbackContext": null
78-
}
79-
$ sam local invoke TestEntrypoint --event test.json
59+
$ sam local invoke --event sam-tests/create.json TestEntrypoint
8060
```
8161

8262
Development

jest.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ module.exports = {
1313
statements: 90,
1414
},
1515
},
16+
coverageDirectory: 'coverage/ts',
1617
collectCoverage: true,
17-
coverageReporters: ['lcov', 'html', 'text-summary'],
18+
coverageReporters: ['json', 'lcov', 'text'],
1819
};

0 commit comments

Comments
 (0)