From a02c192f6e6420a7a281d5e3e7b1cf8ac55ef850 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20Fredrik=20Ki=C3=A6r?= <31612826+anders-kiaer@users.noreply.github.com> Date: Tue, 28 Apr 2020 11:29:39 +0200 Subject: [PATCH] Use GitHub workflow as CI/CD (#34) --- .github/workflows/webviz-config-equinor.yml | 58 +++++++++++++++++++++ .travis.yml | 27 ---------- README.md | 5 +- 3 files changed, 61 insertions(+), 29 deletions(-) create mode 100644 .github/workflows/webviz-config-equinor.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/webviz-config-equinor.yml b/.github/workflows/webviz-config-equinor.yml new file mode 100644 index 0000000..8534ccf --- /dev/null +++ b/.github/workflows/webviz-config-equinor.yml @@ -0,0 +1,58 @@ +name: webviz-config-equinor + +on: + push: + branches: + - master + pull_request: + branches: + - master + release: + types: + - published + schedule: + # Run CI daily and check that tests are working with latest dependencies + - cron: '0 0 * * *' + +jobs: + + webviz-config-equinor: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ['3.6', '3.7', '3.8'] + + steps: + - name: ๐Ÿ“– Checkout commit locally + uses: actions/checkout@v2 + + - name: ๐Ÿ Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python-version }} + + - name: ๐Ÿ“ฆ Install webviz-config-equinor with dependencies + run: | + pip install --upgrade pip + pip install . + + - name: ๐Ÿ“ฆ Install test dependencies + run: | + pip install .[tests] + + - name: ๐Ÿงพ List all installed packages + run: pip freeze + + - name: ๐Ÿ•ต๏ธ Check code style & linting + run: | + black --check webviz_config_equinor setup.py + + - name: ๐Ÿšข Build and deploy Python package + if: github.event_name == 'release' && matrix.python-version == '3.6' + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.pypi_webviz_token }} + run: | + python -m pip install --upgrade setuptools wheel twine + python setup.py bdist_wheel + twine upload dist/* diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 308758d..0000000 --- a/.travis.yml +++ /dev/null @@ -1,27 +0,0 @@ -language: python -cache: pip - -addons: - chrome: stable - -python: - - "3.6" - - "3.7" - - "3.8" - -before_install: - - sudo apt-get -qq update - -script: - - pip install . - - pip install .[tests] - - black webviz_config_equinor setup.py - -deploy: - - provider: pypi - user: webviz - password: - secure: RcB40fO+hek+prhJZ1dlaoazZ6Kf/l6Hrt5Xw4UDtrPXOeaG1BSS+CcS2u7s6Hhbrj77HnQTjVreOY63Iw8UW3wc0vpIkaAyqcZ9dXdjsR45G/p43jSmoc6oPK26W7H1sOb7hJYhZ5rWI0pMcmAs+9RVncj4hZaKBr0sieJTvBn+zfWfghayTv0USR5J2C7HYGCsEbZjBdtahGssFMGr/MOYWSCYePQ8QsZo0qm/1rEbAOYilaBz4lmanvW444FOl2mcH9cPVbNT97gnQzSVs9vHIhmZY1Zos3cV2ymrh8M5CG4qXAY58lAJPyGWPsBeulBeD4kiqNp4c+CknPlDi1tPv0boxHlBs7WVlJjLETITKS/uyGRaIuMFix5pH1XlTAZ9F/LM1Em/lPOAeL7xg6PqTggwA7mL3Y0ITIiq/5QmedxyGatrCG2pQtFF9pFmMQ7pkgrN/qETVT4A1dwXb0RREEiQfmFBWaK+aM+05gjw3mzX+dTUuebxYga5mG99qs3shGDthwUIEKGV7GvlR4F97fRPNLN7F2hvgYffqH4qUg+zUc+5dirFpKPYM1mdd638JcVUbYZw/c3KmjUJp5CA4Ozh4cQ9b1iNv1Hp1DjlYNM4yp6LwDppMsHsAMFtW66og548yMhJELhw3DoM+QuHaixlLEvMZfEx1vbz6a4= - on: - python: "3.6" - tags: true diff --git a/README.md b/README.md index c4f44a9..70012d3 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ [![PyPI version](https://badge.fury.io/py/webviz-config-equinor.svg)](https://badge.fury.io/py/webviz-config-equinor) -[![Build Status](https://travis-ci.org/equinor/webviz-config-equinor.svg?branch=master)](https://travis-ci.org/equinor/webviz-config-equinor) -[![Codacy Badge](https://api.codacy.com/project/badge/Grade/eafe7dfd1b274c02a78de59bb8b8778f)](https://www.codacy.com/app/anders-kiaer/webviz-config-equinor?utm_source=github.com&utm_medium=referral&utm_content=equinor/webviz-config-equinor&utm_campaign=Badge_Grade) +[![Build Status](https://github.com/equinor/webviz-config-equinor/workflows/webviz-config-equinor/badge.svg)](https://github.com/equinor/webviz-config-equinor/actions?query=branch%3Amaster) +[![Total alerts](https://img.shields.io/lgtm/alerts/g/equinor/webviz-config-equinor.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/equinor/webviz-config-equinor/alerts/) +[![Language grade: Python](https://img.shields.io/lgtm/grade/python/g/equinor/webviz-config-equinor.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/equinor/webviz-config-equinor/context:python) [![Python 3.6 | 3.7 | 3.8](https://img.shields.io/badge/python-3.6%20|%203.7%20|%203.8-blue.svg)](https://www.python.org/) ![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)