Skip to content

Commit

Permalink
Rework github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
utf committed Jun 3, 2021
1 parent 49206e0 commit a806c5a
Show file tree
Hide file tree
Showing 7 changed files with 167 additions and 102 deletions.
36 changes: 0 additions & 36 deletions .github/workflows/docs.yml

This file was deleted.

33 changes: 0 additions & 33 deletions .github/workflows/lint.yml

This file was deleted.

19 changes: 0 additions & 19 deletions .github/workflows/merge-deps.yml

This file was deleted.

112 changes: 101 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,51 +1,141 @@
name: Release and publish
name: release

on:
push:
tags:
- 'v*'
branches:
- main

jobs:
release:
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install .[fireworks]
pip install .[vis]
pip install .[dev]
- name: Lint
run: pre-commit run --all-files

test:
services:
local_mongodb:
image: mongo:4.0
ports:
- 27017:27017

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ 3.7, 3.8, 3.9 ]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2.3.4

- uses: actions/setup-python@v2
- uses: actions/setup-python@v2.2.2
with:
python-version: 3.8
python-version: ${{ matrix.python-version }}

- name: Setup Graphviz
uses: ts-graphviz/setup-graphviz@v1

- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('**/setup.py') }}
restore-keys: |
${{ runner.os }}-${{ matrix.python-version }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install .[tests]
pip install .[fireworks]
pip install .[vis]
- name: Test
run: python setup.py test
run: pytest --cov=jobflow --cov-report=xml

- uses: codecov/codecov-action@v1
if: matrix.python-version == 3.8 && github.repository == 'hackingmaterials/jobflow'
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml

docs:
needs:
- lint
- test

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Install pandoc
run: sudo apt-get install pandoc

- uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -e .[docs]
pip install -e .[fireworks]
- name: Build
run: sphinx-build docs/src docs_build

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
publish_dir: ./docs_build

release:

needs:
- lint
- test
- docs

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Build packages
run: |
pip install setuptools setuptools_scm wheel
python setup.py sdist bdist_wheel
- name: Remove newline from github secret
run: echo "PYPI_PASSWORD=$(echo -n ${{ secrets.PYPI_PASSWORD }})" >> $GITHUB_ENV

- name: Publish
uses: pypa/gh-action-pypi-publish@master
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ env.PYPI_PASSWORD }}
password: ${{ secrets.PYPI_PASSWORD }}

- name: Write release info
run: |
Expand Down
61 changes: 60 additions & 1 deletion .github/workflows/tests.yml → .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run tests
name: testing

on:
push:
Expand All @@ -9,7 +9,30 @@ on:
branches:
- main


jobs:
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install .[fireworks]
pip install .[vis]
pip install .[dev]
- name: Lint
run: pre-commit run --all-files

test:
services:
local_mongodb:
Expand Down Expand Up @@ -56,3 +79,39 @@ jobs:
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml

docs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Install pandoc
run: sudo apt-get install pandoc

- uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -e .[docs]
pip install -e .[fireworks]
- name: Build
run: sphinx-build docs/src docs_build

merge-deps:
needs:
- lint
- test
- docs
runs-on: ubuntu-latest
steps:
- name: Merge me!
uses: ridedott/merge-me-action@master
with:
GITHUB_LOGIN: dependabot
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Pre-commit auto-update
name: pre-commit-auto-update

on:
schedule:
Expand Down
6 changes: 5 additions & 1 deletion docs/src/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,8 @@ Change log
v0.0.1
------

Initial release.
Initial release containing:

- ``Job``, ``Flow``, ``Maker``, and ``JobStore`` API.
- Tools for running Flows locally.
- Fireworks integration.

0 comments on commit a806c5a

Please sign in to comment.