Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
57 changes: 57 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Publish to PyPI

on:
release:
types: [published]

jobs:
run-tests:
name: Run tests to avoid a broken release
uses: BIMAU/jadapy/.github/workflows/ci.yml@master

build:
name: Build packages
runs-on: ubuntu-latest
needs:
- run-tests

steps:
- name: Set up Python 3.x
uses: actions/setup-python@v4
with:
python-version: '>=3.8,<4'

- name: Check out the source code
uses: actions/checkout@v3

- name: Build a source package and a wheel
run: python -m build .

- name: Upload packages as artifact
uses: actions/upload-artifact@v4
with:
name: packages-for-pypi
path: dist/

publish:
name: Publish to PyPI
runs-on: ubuntu-latest
needs:
- build

environment:
name: pypi
url: https://pypi.org/p/jadapy

permissions:
id-token: write

steps:
- name: Download artifact with packages
uses: actions/download-artifact@v4
with:
name: packages-for-pypi
path: dist/

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
37 changes: 12 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,53 +1,40 @@
name: Python application
name: Run tests

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_call:

jobs:
build:
strategy:
matrix:
include:
- os: 'ubuntu-latest'
dependencies: ''
- os: 'macos-latest'
dependencies: ''
# - os: 'macos-latest'
# dependencies: 'nlesc/nlesc/trilinos'
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.8, 3.x]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
- uses: actions/checkout@v3

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

- name: Install python dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi

- name: Install Linux dependencies
run: |
sudo apt-get install ${{ matrix.dependencies }}
if: ${{ matrix.os != 'macos-latest' && matrix.dependencies != '' }}

- name: Install macOS dependencies
run: |
brew tap nlesc/nlesc
brew install ${{ matrix.dependencies }}
if: ${{ matrix.os == 'macos-latest' && matrix.dependencies != '' }}
pip install -r requirements.txt

- name: Lint with flake8
run: |
flake8 . --count --show-source --statistics

- name: Test with pytest
run: |
pytest tests
pytest -v -o console_output_style=classic tests
6 changes: 3 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = jadapy
version = 0.0.0
version = 1.0.0
url = https://github.com/BIMAU/jadapy
license = Apache License 2.0
author = Sven Baars
Expand All @@ -9,7 +9,7 @@ description = Implementations of JDQR and JDQZ with optional integration with Tr
long_description = file: README.md
long_description_content_type = text/markdown
classifiers =
Development Status :: 3 - Alpha
Development Status :: 5 - Production/Stable
Environment :: Console
Intended Audience :: Developers
Intended Audience :: Science/Research
Expand Down Expand Up @@ -40,4 +40,4 @@ norecursedirs = lib
ignore = E226,E261,E302,E731,C901,W503
max-line-length = 127
max-complexity = 10
exclude = lib
exclude = lib
Loading