Skip to content

Commit

Permalink
build(ci): switch from travis to github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
mostaphaRoudsari committed Dec 4, 2020
1 parent b2b8722 commit 880e74b
Show file tree
Hide file tree
Showing 3 changed files with 107 additions and 50 deletions.
104 changes: 104 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
---
name: CI

on: [push, pull_request]

jobs:

test:
name: Unit tests
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: set up Python
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: install python dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r dev-requirements.txt
- name: run tests
run: python -m pytest --cov=. tests/
- name: run test coverage
run: |
coverage report
coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

deploy:
name: Deploy to GitHub and PyPI
runs-on: ubuntu-latest
needs: test
if: github.ref == 'refs/heads/master' && github.repository_owner == 'ladybug-tools'
steps:
- uses: actions/checkout@v2
- name: set up Python
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: set up node # we need node for for semantic release
uses: actions/setup-node@v2.1.2
with:
node-version: 14.2.0
- name: install python dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r dev-requirements.txt
pip install -U .
- name: install semantic-release
run:
npm install @semantic-release/exec
- name: run semantic release
run:
npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}

docs:
name: Generate docs
runs-on: ubuntu-latest
needs: test
if: github.ref == 'refs/heads/master' && github.repository_owner == 'ladybug-tools'
steps:
- uses: actions/checkout@v2
- name: set up Python
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: set up node # we need node for for redocly
uses: actions/setup-node@v2.1.2
with:
node-version: 14.2.0
- name: install semantic-release
run:
npm install -g redoc-cli
- name: install python dependencies
run: |
pip install -U .
pip install -r dev-requirements.txt
- name: generate docs
run: |
python docs.py $(echo $VERSION | sed 's/v//')
redoc-cli bundle ./docs/model_inheritance.json -o ./docs/model.html
env:
VERSION: ${{ github.event.client_payload.version }}

- name: deploy to github pages
uses: peaceiris/actions-gh-pages@v3
with:
# this will use ladybugbot token
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: docs/_build/
force_orphan: true
keep_files: false
full_commit_message: 'deploy: update docs'
49 changes: 0 additions & 49 deletions .travis.yml

This file was deleted.

4 changes: 3 additions & 1 deletion dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ coveralls==2.2.0
pytest==6.1.2
pytest-cov==2.10.1
twine==3.2.0
importlib-metadata==3.1.0
wheel==0.36.0
setuptools==50.3.2
importlib-metadata==3.1.1

0 comments on commit 880e74b

Please sign in to comment.