From 13f48fe4f3859f390f5f88da89356cba4b567927 Mon Sep 17 00:00:00 2001 From: Carles Sala Date: Wed, 11 Aug 2021 18:35:46 +0200 Subject: [PATCH 1/2] Reorganize workflows and add codecov --- .github/workflows/docs.yml | 5 +- .github/workflows/lint.yml | 21 ++++++++ .github/workflows/minimum.yml | 25 +++++++++ .github/workflows/readme.yml | 25 +++++++++ .github/workflows/tests.yml | 93 --------------------------------- .github/workflows/tutorials.yml | 22 ++++++++ .github/workflows/unit.yml | 28 ++++++++++ README.md | 2 +- tasks.py | 2 +- 9 files changed, 124 insertions(+), 99 deletions(-) create mode 100644 .github/workflows/lint.yml create mode 100644 .github/workflows/minimum.yml create mode 100644 .github/workflows/readme.yml delete mode 100644 .github/workflows/tests.yml create mode 100644 .github/workflows/tutorials.yml create mode 100644 .github/workflows/unit.yml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index e996a643..f72409b0 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -5,17 +5,14 @@ on: branches: [ stable ] jobs: - docs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - - name: Python + - name: Set up Python 3.8 uses: actions/setup-python@v1 with: python-version: 3.8 - - name: Build run: | sudo apt-get install pandoc diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000..2f76fd95 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,21 @@ +name: Style Checks + +on: + - push + - pull_request + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Set up Python 3.8 + uses: actions/setup-python@v1 + with: + python-version: 3.8 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install tox tox-gh-actions + - name: Test with tox + run: tox -e lint diff --git a/.github/workflows/minimum.yml b/.github/workflows/minimum.yml new file mode 100644 index 00000000..12118926 --- /dev/null +++ b/.github/workflows/minimum.yml @@ -0,0 +1,25 @@ +name: Unit Tests Minimum Versions + +on: + - push + - pull_request + +jobs: + minimum: + runs-on: ${{ matrix.os }} + strategy: + matrix: + python-version: [3.6, 3.7, 3.8] + os: [ubuntu-latest, macos-latest, windows-latest] + steps: + - uses: actions/checkout@v1 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install tox tox-gh-actions + - name: Test with tox + run: tox -e minimum diff --git a/.github/workflows/readme.yml b/.github/workflows/readme.yml new file mode 100644 index 00000000..9fb16313 --- /dev/null +++ b/.github/workflows/readme.yml @@ -0,0 +1,25 @@ +name: Test README + +on: + - push + - pull_request + +jobs: + readme: + runs-on: ${{ matrix.os }} + strategy: + matrix: + python-version: [3.6, 3.7, 3.8] + os: [ubuntu-latest, macos-latest] # skip windows bc rundoc fails + steps: + - uses: actions/checkout@v1 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install tox tox-gh-actions + - name: Run the README.md + run: tox -e readme diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml deleted file mode 100644 index fd244081..00000000 --- a/.github/workflows/tests.yml +++ /dev/null @@ -1,93 +0,0 @@ -name: Run Tests - -on: - push: - branches: [ '*' ] - pull_request: - branches: [ master ] - -jobs: - lint: - runs-on: ${{ matrix.os }} - strategy: - matrix: - python-version: [3.6, 3.7, 3.8] - os: [ubuntu-latest, macos-latest, windows-latest] - steps: - - uses: actions/checkout@v1 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 - with: - python-version: ${{ matrix.python-version }} - - name: Install package - run: pip install invoke .[dev] - - name: invoke lint - run: invoke lint - - readme: - runs-on: ${{ matrix.os }} - strategy: - matrix: - python-version: [3.6, 3.7, 3.8] - os: [ubuntu-latest, macos-latest] - steps: - - uses: actions/checkout@v1 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 - with: - python-version: ${{ matrix.python-version }} - - name: Install package and dependencies - run: pip install invoke rundoc . - - name: invoke readme - run: invoke readme - - unit: - runs-on: ${{ matrix.os }} - strategy: - matrix: - python-version: [3.6, 3.7, 3.8] - os: [ubuntu-latest, macos-latest, windows-latest] - steps: - - uses: actions/checkout@v1 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 - with: - python-version: ${{ matrix.python-version }} - - name: Install package and dependencies - run: pip install invoke .[test] - - name: invoke pytest - run: invoke pytest - - minimum: - runs-on: ${{ matrix.os }} - strategy: - matrix: - python-version: [3.6, 3.7, 3.8] - os: [ubuntu-latest, macos-latest] - steps: - - uses: actions/checkout@v1 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 - with: - python-version: ${{ matrix.python-version }} - - name: Install package and dependencies - run: pip install invoke .[test] - - name: invoke minimum - run: invoke minimum - - tutorials: - runs-on: ${{ matrix.os }} - strategy: - matrix: - python-version: [3.6, 3.7, 3.8] - os: [ubuntu-latest] - steps: - - uses: actions/checkout@v1 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 - with: - python-version: ${{ matrix.python-version }} - - name: Install package and dependencies - run: pip install invoke jupyter .[tutorials] - - name: invoke tutorials - run: invoke tutorials \ No newline at end of file diff --git a/.github/workflows/tutorials.yml b/.github/workflows/tutorials.yml new file mode 100644 index 00000000..c44c4d13 --- /dev/null +++ b/.github/workflows/tutorials.yml @@ -0,0 +1,22 @@ +name: Run Tutorials + +on: + - push + - pull_request + +jobs: + tutorials: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.6, 3.7, 3.8] + steps: + - uses: actions/checkout@v1 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python-version }} + - name: Install package and dependencies + run: pip install invoke jupyter .[tutorials] + - name: invoke tutorials + run: invoke tutorials diff --git a/.github/workflows/unit.yml b/.github/workflows/unit.yml new file mode 100644 index 00000000..0da10d67 --- /dev/null +++ b/.github/workflows/unit.yml @@ -0,0 +1,28 @@ +name: Unit Tests + +on: + - push + - pull_request + +jobs: + unit: + runs-on: ${{ matrix.os }} + strategy: + matrix: + python-version: [3.6, 3.7, 3.8] + os: [ubuntu-latest, macos-latest, windows-latest] + steps: + - uses: actions/checkout@v1 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install invoke .[test] + - name: Invoke pytest + run: invoke pytest + - if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.8 + name: Upload codecov report + uses: codecov/codecov-action@v2 diff --git a/README.md b/README.md index ba1cfb58..db6df98a 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ [![Development Status](https://img.shields.io/badge/Development%20Status-2%20--%20Pre--Alpha-yellow)](https://pypi.org/search/?c=Development+Status+%3A%3A+2+-+Pre-Alpha) [![PyPi Shield](https://img.shields.io/pypi/v/copulas.svg)](https://pypi.python.org/pypi/copulas) [![Downloads](https://pepy.tech/badge/copulas)](https://pepy.tech/project/copulas) -[![Tests](https://github.com/sdv-dev/Copulas/workflows/Run%20Tests/badge.svg)](https://github.com/sdv-dev/Copulas/actions?query=workflow%3A%22Run+Tests%22+branch%3Amaster) +[![Unit Tests](https://github.com/csala/Copulas/actions/workflows/unit.yml/badge.svg)](https://github.com/csala/Copulas/actions/workflows/unit.yml) [![Coverage Status](https://codecov.io/gh/sdv-dev/Copulas/branch/master/graph/badge.svg)](https://codecov.io/gh/sdv-dev/Copulas) Copulas diff --git a/tasks.py b/tasks.py index dc9e2ab8..66e2193a 100644 --- a/tasks.py +++ b/tasks.py @@ -10,7 +10,7 @@ @task def pytest(c): - c.run('python -m pytest --cov=copulas --reruns 3') + c.run('python -m pytest --cov=copulas --reruns 3 --cov-report=xml') @task From 47a906257c282cab83d63a0d18a4a6c3551b34e5 Mon Sep 17 00:00:00 2001 From: Carles Sala Date: Wed, 11 Aug 2021 18:52:19 +0200 Subject: [PATCH 2/2] Fix wrong repo name --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index db6df98a..bef01eab 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ [![Development Status](https://img.shields.io/badge/Development%20Status-2%20--%20Pre--Alpha-yellow)](https://pypi.org/search/?c=Development+Status+%3A%3A+2+-+Pre-Alpha) [![PyPi Shield](https://img.shields.io/pypi/v/copulas.svg)](https://pypi.python.org/pypi/copulas) [![Downloads](https://pepy.tech/badge/copulas)](https://pepy.tech/project/copulas) -[![Unit Tests](https://github.com/csala/Copulas/actions/workflows/unit.yml/badge.svg)](https://github.com/csala/Copulas/actions/workflows/unit.yml) +[![Unit Tests](https://github.com/sdv-dev/Copulas/actions/workflows/unit.yml/badge.svg)](https://github.com/sdv-dev/Copulas/actions/workflows/unit.yml) [![Coverage Status](https://codecov.io/gh/sdv-dev/Copulas/branch/master/graph/badge.svg)](https://codecov.io/gh/sdv-dev/Copulas) Copulas