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
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
name: Paper Build

on: [push, pull_request]
name: Build Paper
on:
workflow_dispatch:
pull_request:
branches:
- master

jobs:
paper:
runs-on: ubuntu-latest
name: Paper Draft
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v6

- name: Build draft PDF
uses: openjournals/openjournals-draft-action@master
with:
journal: joss
# This should be the path to the paper within your repo.
paper-path: paper/paper.md

- name: Upload
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v6
with:
name: paper
# This is the output path where Pandoc will write the compiled
Expand Down
38 changes: 26 additions & 12 deletions .github/workflows/pypackage.yml → .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,53 @@
name: Build Wheel
on: [workflow_call]

name: Build
on:
workflow_dispatch:
workflow_call:
pull_request:
branches:
- master

jobs:
build-wheel:
name: Build Wheel for Testing
build:
name: Build UncertainSCI wheel and tarball
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v6

- name: Setup Python 3.9
uses: actions/setup-python@v3
uses: actions/setup-python@v6
with:
python-version: 3.9
cache: 'pip' # optional, adds caching for faster builds

- name: Install pypa/build
run: >-
python -m
pip install
build
--user

- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
- name: install check-wheel-contents

- name: Install check-wheel-contents
run: >-
python3 -m
pip install
check-wheel-contents
- name: check wheel

- name: Check wheel
run: >-
check-wheel-contents
dist/*.whl
- uses: actions/upload-artifact@v3

- name: Upload Artifact
uses: actions/upload-artifact@v6
with:
path: ./dist/*

name: uncertainsci-packages
path: dist
32 changes: 32 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Lint
on:
workflow_dispatch:
workflow_call:
pull_request:
branches:
- master

jobs:
lint:
name: Lint UncertainSCI
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6

- name: Setup Python 3.9
uses: actions/setup-python@v6
with:
python-version: 3.9
cache: 'pip' # optional, adds caching for faster builds

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8
pip install -r requirements.txt

- name: Lint with flake8
run: |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --max-complexity=10 --max-line-length=127 --statistics
39 changes: 39 additions & 0 deletions .github/workflows/publish-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Publish Package (TestPyPI/dry run)
on:
workflow_dispatch:
workflow_call:
push:
tags:
- 'v[0-9]+*test*'
- '*test*-v[0-9]+'

jobs:
lint:
uses: ./.github/workflows/lint.yml

build:
uses: ./.github/workflows/build.yml

test:
uses: ./.github/workflows/test.yml

upload_testpypi:
name: Publish build to TestPyPI
needs: [lint, build, test]
runs-on: ubuntu-latest
environment:
name: pypi
url: https://test.pypi.org/p/UncertainSCI
permissions:
id-token: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v7
with:
name: uncertainsci-packages
path: dist

- name: Upload to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist
41 changes: 41 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Publish Package
on:
workflow_dispatch:
workflow_call:
push:
tags:
- 'v[0-9]+'

jobs:
lint:
uses: ./.github/workflows/lint.yml

build:
uses: ./.github/workflows/build.yml

test:
uses: ./.github/workflows/test.yml

publish-test:
uses: ./.github/workflows/publish-test.yml

upload_pypi:
name: Publish build to PyPI
needs: [lint, build, test, publish-test]
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/UncertainSCI
permissions:
id-token: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v7
with:
name: uncertainsci-packages
path: dist

- name: Upload to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist
45 changes: 0 additions & 45 deletions .github/workflows/pypublish.yml

This file was deleted.

57 changes: 28 additions & 29 deletions .github/workflows/pythonapp.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,69 +1,68 @@
name: Build

on: [push, pull_request]
name: Test
on:
workflow_dispatch:
workflow_call:
pull_request:
branches:
- master

jobs:
build:

test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
python-version: ["3.9", "3.10", "3.11"]

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

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: 'pip' # optional, adds caching for faster builds

- name: Display Python version
run: python -c "import sys; print(sys.version)"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest pytest-cov
pip install pytest pytest-cov
pip install -r requirements.txt
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test build

- name: Install UncertainSCI
run: |
pip install --editable ./
- name: Run tests with pytest
continue-on-error: true
run: |
pytest
- name: Test coverage with pytest
continue-on-error: true

- name: Run tests and compute coverage
run: |
pytest --cov=UncertainSCI
- name: Upload coverage data to coveralls.io

- name: Upload coverage to coveralls.io
continue-on-error: true
run: |
pip install coveralls
coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: ${{ matrix.os }}
COVERALLS_PARALLEL: true

coveralls:
name: confirm coveralls upload
needs: build
name: Confirm coveralls.io reporting
needs: test
runs-on: ubuntu-latest
container: python:3-slim

steps:
- name: Finished
- name: Finish coveralls.io reporting
continue-on-error: true
run: |
pip3 install --upgrade pip
pip3 install --upgrade coveralls
coveralls --service=github --finish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}



6 changes: 0 additions & 6 deletions .github/workflows/testpackage.yml

This file was deleted.

Loading