Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
github: add actions to replace travis
- Loading branch information
Showing
1 changed file
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: Build and release | ||
|
||
on: | ||
push: | ||
branches: [master] | ||
pull_request: | ||
branches: [master] | ||
|
||
jobs: | ||
Test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [2.7, 3.6] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
fetch-depth: 0 | ||
|
||
- name: Setup nodejs | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 10.14.0 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install npm dependencies | ||
run: | | ||
npm install buffer-shims | ||
npm install --global rollup | ||
- name: Install python dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -e .[tests,docs] | ||
- name: Show python dependencies | ||
run: | | ||
pip freeze | ||
- name: Run tests | ||
run: | | ||
./run-tests.sh | ||
- name: Publish package | ||
if: ${{ success() && github.event_name == 'push' && matrix.python-version == '2.7' }} | ||
uses: pypa/gh-action-pypi-publish@master | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.pypi_password }} | ||
|
||
- name: Run build npm package | ||
if: ${{ success() && github.event_name == 'push' && matrix.python-version == '2.7' }} | ||
working-directory: . | ||
run: | | ||
./build-npm-package.sh |