Skip to content

Commit

Permalink
added ci (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Kraus authored Apr 20, 2022
1 parent b08ffa4 commit efabae4
Show file tree
Hide file tree
Showing 6 changed files with 180 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/before-job/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: "Before job script"
description: "Set up a python dev environment."
runs:
using: "composite"
steps:
- run: python -V
shell: bash
- run: pip install virtualenv
shell: bash
- run: virtualenv venv
shell: bash
- run: source venv/bin/activate || source venv/Scripts/activate
shell: bash
9 changes: 9 additions & 0 deletions .github/workflows/build-job/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: "Build job"
description: "Build the package."
runs:
using: "composite"
steps:
- run: pip install wheel
shell: bash
- run: python setup.py bdist_wheel
shell: bash
9 changes: 9 additions & 0 deletions .github/workflows/docs-job/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: "Docs build job"
description: "Build the documentation."
runs:
using: "composite"
steps:
- run: sphinx-apidoc -o docs/source src/dgpost -T -M
shell: bash
- run: sphinx-build -W -b html docs/source public/master
shell: bash
67 changes: 67 additions & 0 deletions .github/workflows/pull-request-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: pull-request-commit
on:
pull_request:
branches:
- master
jobs:
build:
strategy:
matrix:
pyver: ['3.9']
os: ['ubuntu-latest', 'windows-latest']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.pyver }}
- uses: ./.github/workflows/before-job
- uses: ./.github/workflows/build-job
- uses: actions/upload-artifact@v2
with:
name: dist-${{ matrix.os }}-${{ matrix.pyver }}
path: dist
test:
needs: [build]
strategy:
matrix:
pyver: ['3.9']
os: ['ubuntu-latest', 'windows-latest']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.pyver }}
- uses: ./.github/workflows/before-job
- uses: actions/download-artifact@v2
with:
name: dist-${{ matrix.os }}-${{ matrix.pyver }}
- run: pip install --pre --find-links=. tomato[testing]
shell: bash
- uses: ./.github/workflows/test-job
# pages:
# needs: [build]
# strategy:
# matrix:
# pyver: ['3.9']
# os: ['ubuntu-latest']
# runs-on: ${{ matrix.os }}
# steps:
# - uses: actions/checkout@v2
# - uses: actions/setup-python@v2
# with:
# python-version: ${{ matrix.pyver }}
# - uses: ./.github/workflows/before-job
# - uses: actions/download-artifact@v2
# with:
# name: dist-${{ matrix.os }}-${{ matrix.pyver }}
# - run: pip install --pre --find-links=. dgpost[docs]
# shell: bash
# - uses: ./.github/workflows/docs-job
# - uses: actions/upload-artifact@v2
# with:
# name: public-${{ matrix.os }}-${{ matrix.pyver }}
# path: public
73 changes: 73 additions & 0 deletions .github/workflows/push-master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: push-master
on:
push:
branches: ['master']
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-python@v2
with:
python-version: '3.9'
- uses: ./.github/workflows/before-job
- uses: ./.github/workflows/build-job
- uses: actions/upload-artifact@v2
with:
name: dist-master
path: dist
test:
needs: [build]
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-python@v2
with:
python-version: '3.9'
- uses: ./.github/workflows/before-job
- uses: actions/download-artifact@v2
with:
name: dist-master
- run: pip install --pre --find-links=. tomato[testing]
shell: bash
- uses: ./.github/workflows/test-job
# pages:
# needs: [build]
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - uses: actions/setup-python@v2
# with:
# python-version: '3.9'
# - uses: ./.github/workflows/before-job
# - uses: actions/download-artifact@v2
# with:
# name: dist-master
# - run: pip install --pre --find-links=. dgpost[docs]
# shell: bash
# - uses: ./.github/workflows/docs-job
# - uses: actions/upload-artifact@v2
# with:
# name: public-master
# path: public/master
# deploy:
# needs: [pages]
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - uses: actions/setup-python@v2
# with:
# python-version: '3.9'
# - uses: actions/download-artifact@v2
# with:
# name: public-master
# path: public/master
# - uses: peaceiris/actions-gh-pages@v3
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# publish_dir: ./public
# keep_files: true
9 changes: 9 additions & 0 deletions .github/workflows/test-job/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: "Test job"
description: "Test the package with pytest."
runs:
using: "composite"
steps:
- run: tomato --version
shell: bash
- run: pytest -vv
shell: bash

0 comments on commit efabae4

Please sign in to comment.