Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pyproject code refactor #289

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 0 additions & 85 deletions .github/workflows/cd-build.yml

This file was deleted.

75 changes: 75 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: CD

on:
push:
branches:
- master
- main

jobs:

coverage:
name: Deploy Coverage Results
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: 3.11

- name: Check Python version
run: python --version

- name: Install package
run: python -m pip install ".[release,test]"

- name: Run tests
run: pytest -n auto

- name: Check distribution
run: |
python -m build
python -m twine check dist/*

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage.xml
flags: unittests

docs:
name: Deploy API Documentation
needs: coverage
runs-on: ubuntu-latest
if: success()

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: 3.11

- name: Check Python version
run: python --version

- name: Install package
run: python -m pip install ".[docs]"

- name: Build API documentation
run: |
sphinx-apidoc -t docs/_templates -feTMo docs/source modopt
sphinx-build -E docs/source docs/_build

- name: Deploy API documentation
uses: peaceiris/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/_build
118 changes: 0 additions & 118 deletions .github/workflows/ci-build.yml

This file was deleted.

51 changes: 51 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: CI

on:
pull_request:
branches:
- develop
- master
- main

jobs:
test-full:
name: Run CI Tests
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ["3.11"]

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Check Python version
run: python --version

- name: Install package
run: python -m pip install ".[extra,test]"

- name: Run tests
run: python -m pytest -n auto

- name: Save test results
if: always()
uses: actions/upload-artifact@v2
with:
name: unit-test-results-${{ matrix.os }}-${{ matrix.python-version }}
path: pytest.xml

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage.xml
flags: unittests
37 changes: 37 additions & 0 deletions .github/workflows/test-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Test Docs

on: [workflow_dispatch]

jobs:

build-docs:
name: Test Docs Build
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: 3.11

- name: Check Python version
run: python --version

- name: Install package
run: python -m pip install ".[docs]"

- name: Test API documentation build
run: |
sphinx-apidoc -t docs/_templates -feTMo docs/source modopt
sphinx-build -b doctest -E docs/source docs/_build

- name: Archive API documentation build
uses: actions/upload-artifact@v2
with:
name: api-docs
retention-days: 14
path: |
docs/_build
Loading