Skip to content

Commit fbb9d6a

Browse files
diningPhilosopher64Prabhakar Kumar
authored andcommitted
Adding YAML files to run tests on every push to GH & release to PyPi on every new release created.
1 parent 65f4c9d commit fbb9d6a

File tree

4 files changed

+149
-75
lines changed

4 files changed

+149
-75
lines changed

.github/workflows/continuous-deployment.yml

Lines changed: 0 additions & 74 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# Copyright 2020-2021 The MathWorks, Inc
2+
name: Release to PyPI
3+
4+
on:
5+
release:
6+
types: [created]
7+
8+
jobs:
9+
node_tests:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v2
15+
with:
16+
ref: ${{github.sha}}
17+
18+
- name: Use Node.js 13.x
19+
uses: actions/setup-node@v2
20+
with:
21+
node-version: 13.x
22+
23+
- name: Install Node dependencies
24+
run: npm --prefix gui install gui
25+
26+
- name: Build Project
27+
run: npm --prefix gui build --if-present
28+
29+
- name: Run Node tests
30+
run: npm --prefix gui test
31+
32+
python_tests:
33+
runs-on: ubuntu-latest
34+
35+
steps:
36+
- name: Checkout
37+
uses: actions/checkout@v2
38+
with:
39+
ref: ${{github.sha}}
40+
41+
- name: Set up Python 3.7
42+
uses: actions/setup-python@v2
43+
with:
44+
python-version: 3.7
45+
46+
- name: Install dependencies
47+
run: |
48+
python -m pip install --upgrade pip
49+
python -m pip install --upgrade black
50+
51+
- name: Lint with black
52+
run: black --check .
53+
54+
- name: Run Python Tests
55+
run: python setup.py test
56+
57+
build_and_publish:
58+
needs: [python_tests, node_tests]
59+
if: success()
60+
runs-on: ubuntu-latest
61+
62+
steps:
63+
- name: Checkout
64+
uses: actions/checkout@v2
65+
with:
66+
ref: ${{github.sha}}
67+
68+
- name: Set up Python 3.7
69+
uses: actions/setup-python@v2
70+
with:
71+
python-version: 3.7
72+
73+
- name: Use Node.js 13.x
74+
uses: actions/setup-node@v2
75+
with:
76+
node-version: 13.x
77+
78+
- name: Install Python build dependencies
79+
run: |
80+
python -m pip install --upgrade pip
81+
python -m pip install wheel
82+
83+
- name: Build Source and Binary wheel distributions
84+
run: python setup.py bdist_wheel sdist
85+
86+
- name: Publish to PyPI.
87+
uses: pypa/gh-action-pypi-publish@release/v1
88+
with:
89+
user: __token__
90+
verbose: true
91+
password: ${{ secrets.PYPI_TOKEN }}
92+
repository_url: https://upload.pypi.org/legacy/

.github/workflows/run-tests.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: MATLAB Jupyter Integration
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
8+
jobs:
9+
node_tests:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v2
15+
16+
- name: Use Node.js 13.x
17+
uses: actions/setup-node@v2
18+
with:
19+
node-version: 13.x
20+
21+
- name: Install Node dependencies
22+
run: npm --prefix gui install gui
23+
24+
- name: Build Project
25+
run: npm --prefix gui build --if-present
26+
27+
- name: Run Node tests
28+
run: npm --prefix gui test
29+
30+
python_tests:
31+
runs-on: ubuntu-latest
32+
strategy:
33+
matrix:
34+
python-version: [3.7, 3.8]
35+
36+
steps:
37+
- name: Checkout
38+
uses: actions/checkout@v2
39+
40+
- name: Set up Python ${{ matrix.python-version }}
41+
uses: actions/setup-python@v2
42+
with:
43+
python-version: ${{ matrix.python-version }}
44+
45+
- name: Install dependencies
46+
run: |
47+
python -m pip install --upgrade pip
48+
pip install black pytest
49+
50+
- name: Lint with black
51+
run: |
52+
black --check .
53+
54+
- name: Test with pytest
55+
run: |
56+
python setup.py test

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def run(self):
5858
packages=setuptools.find_packages(exclude=["devel", "tests"]),
5959
keywords=["Jupyter"],
6060
classifiers=["Framework :: Jupyter"],
61-
python_requires="~=3.6",
61+
python_requires="~=3.7",
6262
install_requires=["jupyter-server-proxy", "aiohttp>=3.7.4"],
6363
setup_requires=["pytest-runner"],
6464
tests_require=tests_require,

0 commit comments

Comments
 (0)