Skip to content

Commit 901ca05

Browse files
committed
Merge branch 'main' into yogesh-41-slider
2 parents 596eb36 + 864bcae commit 901ca05

File tree

8 files changed

+129
-61
lines changed

8 files changed

+129
-61
lines changed

.github/workflows/backend-ci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ on:
44
push:
55
paths:
66
- chartlets.py/**
7+
branches:
8+
- main
9+
pull_request:
10+
paths:
11+
- chartlets.py/**
712

813
jobs:
914
backend:

.github/workflows/frontend-ci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ on:
44
push:
55
paths:
66
- chartlets.js/**
7+
branches:
8+
- main
9+
pull_request:
10+
paths:
11+
- chartlets.js/**
712

813
jobs:
914
frontend:
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Package and Publish
1+
name: Package and Publish to PyPi
22

33
on:
44
release:
@@ -36,14 +36,19 @@ jobs:
3636
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
3737
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
3838
39-
- name: Test with pytest
39+
- name: Run unit tests
40+
shell: bash -l {0}
4041
run: |
41-
pytest --cov=chartlets
42-
42+
pytest --cov=chartlets --cov-report=xml
43+
4344
- name: Upload coverage reports to Codecov
44-
uses: codecov/codecov-action@v3
45-
env:
46-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
45+
uses: codecov/codecov-action@v4
46+
with:
47+
fail_ci_if_error: true
48+
directory: chartlets.py/
49+
flags: backend
50+
verbose: true
51+
token: ${{ secrets.CODECOV_TOKEN }}
4752

4853
PyPi-Deploy:
4954
name: Publish Python Package to PyPI
@@ -77,57 +82,3 @@ jobs:
7782
password: ${{ secrets.PYPI_API_TOKEN }}
7883
packages_dir: chartlets.py/dist
7984
verbose: true
80-
81-
npm-tests:
82-
runs-on: ubuntu-latest
83-
strategy:
84-
matrix:
85-
node-version: [16.x, 18.x, 20.x]
86-
# See supported Node.js release schedule at
87-
# https://nodejs.org/en/about/releases/
88-
defaults:
89-
run:
90-
working-directory: chartlets.js
91-
92-
steps:
93-
- uses: actions/checkout@v3
94-
- name: Use Node.js ${{ matrix.node-version }}
95-
uses: actions/setup-node@v3
96-
with:
97-
node-version: ${{ matrix.node-version }}
98-
cache: 'npm'
99-
cache-dependency-path: chartlets.js/package-lock.json
100-
101-
- run: npm ci
102-
- run: npm run lint
103-
- run: npm run build
104-
- run: npm run test
105-
106-
npm-Deploy:
107-
name: Publish TS-React Package to npmjs
108-
runs-on: ubuntu-latest
109-
needs: npm-tests
110-
defaults:
111-
run:
112-
working-directory: chartlets.js
113-
114-
steps:
115-
- uses: actions/checkout@v4
116-
117-
- name: Set up Node.js
118-
uses: actions/setup-node@v4
119-
with:
120-
node-version: '18.x'
121-
registry-url: 'https://registry.npmjs.org'
122-
cache: 'npm'
123-
cache-dependency-path: chartlets.js/package-lock.json
124-
125-
- run: npm ci
126-
- run: |
127-
cd packages/lib
128-
npm run build
129-
- run: |
130-
cd packages/lib
131-
npm publish --access public
132-
env:
133-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: Package and Publish to NPM
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
8+
jobs:
9+
npm-tests-lib:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
node-version: [16.x, 18.x, 20.x]
14+
# See supported Node.js release schedule at
15+
# https://nodejs.org/en/about/releases/
16+
defaults:
17+
run:
18+
working-directory: chartlets.js/packages/lib
19+
20+
steps:
21+
- uses: actions/checkout@v3
22+
- name: Use Node.js ${{ matrix.node-version }}
23+
uses: actions/setup-node@v3
24+
with:
25+
node-version: ${{ matrix.node-version }}
26+
cache: 'npm'
27+
cache-dependency-path: chartlets.js/package-lock.json
28+
29+
- run: npm ci
30+
- run: npm run lint
31+
- run: npm run test
32+
33+
- run: npm run coverage
34+
- name: Upload coverage reports for lib to Codecov
35+
uses: codecov/codecov-action@v4
36+
with:
37+
fail_ci_if_error: true
38+
directory: coverage/
39+
flags: frontend
40+
verbose: true
41+
token: ${{ secrets.CODECOV_TOKEN }}
42+
43+
- run: npm run build
44+
45+
npm-tests-demo:
46+
runs-on: ubuntu-latest
47+
strategy:
48+
matrix:
49+
node-version: [16.x, 18.x, 20.x]
50+
# See supported Node.js release schedule at
51+
# https://nodejs.org/en/about/releases/
52+
defaults:
53+
run:
54+
working-directory: chartlets.js/packages/demo
55+
56+
steps:
57+
- uses: actions/checkout@v3
58+
- name: Use Node.js ${{ matrix.node-version }}
59+
uses: actions/setup-node@v3
60+
with:
61+
node-version: ${{ matrix.node-version }}
62+
cache: 'npm'
63+
cache-dependency-path: chartlets.js/package-lock.json
64+
65+
- run: npm ci
66+
- run: npm run lint
67+
- run: npm run build
68+
69+
npm-deploy:
70+
name: Publish TS-React Package to npmjs
71+
runs-on: ubuntu-latest
72+
needs: [npm-tests-lib, npm-tests-demo]
73+
defaults:
74+
run:
75+
working-directory: chartlets.js/packages/lib
76+
77+
steps:
78+
- uses: actions/checkout@v4
79+
80+
- name: Set up Node.js
81+
uses: actions/setup-node@v4
82+
with:
83+
node-version: '18.x'
84+
registry-url: 'https://registry.npmjs.org'
85+
cache: 'npm'
86+
cache-dependency-path: chartlets.js/package-lock.json
87+
88+
- run: npm ci
89+
- run: npm run build
90+
- run: npm publish --access public
91+
env:
92+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
# Chartlets
22

33
[![CI](https://github.com/bcdev/chartlets/actions/workflows/frontend-ci.yml/badge.svg)](https://github.com/bcdev/chartlets/actions/workflows/frontend-ci.yml)
4+
[![codecov](https://codecov.io/gh/bcdev/chartlets/graph/badge.svg?token=zJBPMFvnpg&flag=frontend)](https://codecov.io/gh/bcdev/chartlets)
45
[![npm](https://badge.fury.io/js/chartlets.svg)](https://npmjs.org/package/chartlets)
56

67
[![CI](https://github.com/bcdev/chartlets/actions/workflows/backend-ci.yml/badge.svg)](https://github.com/bcdev/chartlets/actions/workflows/backend-ci.yml)
8+
[![codecov](https://codecov.io/gh/bcdev/chartlets/graph/badge.svg?token=zJBPMFvnpg&flag=backend)](https://codecov.io/gh/bcdev/chartlets)
79
[![PyPI](https://img.shields.io/pypi/v/chartlets)](https://pypi.org/project/chartlets/)
810

911
Chartlets is a software framework that allows websites developed with

chartlets.js/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Chartlets
22

33
[![CI](https://github.com/bcdev/chartlets/actions/workflows/frontend-ci.yml/badge.svg)](https://github.com/bcdev/chartlets/actions/workflows/frontend-ci.yml)
4+
[![codecov](https://codecov.io/gh/bcdev/chartlets/graph/badge.svg?token=zJBPMFvnpg&flag=frontend)](https://codecov.io/gh/bcdev/chartlets)
45
[![npm](https://badge.fury.io/js/chartlets.svg)](https://npmjs.org/package/chartlets)
56
![](https://img.shields.io/badge/Linting-TypeScript%20%26%20Prettier-blue?logo=typescript&logoColor=white)
67

chartlets.py/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Chartlets
22

33
[![CI](https://github.com/bcdev/chartlets/actions/workflows/backend-ci.yml/badge.svg)](https://github.com/bcdev/chartlets/actions/workflows/backend-ci.yml)
4+
[![codecov](https://codecov.io/gh/bcdev/chartlets/graph/badge.svg?token=zJBPMFvnpg&flag=backend)](https://codecov.io/gh/bcdev/chartlets)
45
[![PyPI](https://img.shields.io/pypi/v/chartlets)](https://pypi.org/project/chartlets/)
56
[![black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
67

codecov.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
coverage:
2+
status:
3+
project:
4+
default:
5+
target: 80%
6+
7+
flags:
8+
frontend:
9+
carryforward: true
10+
backend:
11+
carryforward: true

0 commit comments

Comments
 (0)