Skip to content

Commit

Permalink
Add GH Actions Support (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
WillianFuks committed Apr 7, 2022
1 parent c9c5df0 commit 383eb33
Show file tree
Hide file tree
Showing 6 changed files with 789 additions and 43 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Publish tfcausalimpct to PyPI

on:
release:
types: [published]


jobs:
build-n-publish:
name: Build and publish to PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install -U setuptools wheel twine
- name: Build dist
run: |
python setup.py sdist bdist_wheel
- name: Upload to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
67 changes: 67 additions & 0 deletions .github/workflows/run-CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Run Unit Tests
on: [push, pull_request]
jobs:
run-CI:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python: [3.6, 3.7, 3.8, 3.9]
exclude:
- os: macos-latest
python: 3.6
- os: macos-latest
python: 3.7
- os: macos-latest
python: 3.8
- os: windows-latest
python: 3.6
- os: windows-latest
python: 3.7
- os: windows-latest
python: 3.8
steps:
- uses: actions/checkout@v2

- name: Python Version ${{ matrix.python }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}

- name: Cache pip
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}
restore-keys: |
${{ runner.os }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools tox tox-gh-actions
- name: Test with tox
run: tox
env:
TOX_SKIP_ENV: coverage,GHA-coverage

- name: Lint
if: ${{ matrix.python == '3.9' && runner.os == 'Linux'}}
run: tox -e lint

- name: isort
if: ${{ matrix.python == '3.9' && runner.os == 'Linux'}}
run: tox -e isort-check


- name: Build Coverage
if: ${{ matrix.python == '3.9' && runner.os == 'Linux'}}
run: tox -e GHA-coverage

- name: Upload Coveralls
if: ${{ matrix.python == '3.9' && runner.os == 'Linux'}}
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: coverage.lcov
29 changes: 0 additions & 29 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion causalimpact/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# limitations under the License.


__version__ = '0.0.10rc0'
__version__ = '0.0.10rc1'
Loading

0 comments on commit 383eb33

Please sign in to comment.