Skip to content

Commit

Permalink
Add reusable workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobbieker committed Oct 26, 2021
1 parent bf15b32 commit 01ee780
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 79 deletions.
8 changes: 8 additions & 0 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[bumpversion]
commit = True
tag = True
current_version = 0.0.4

[bumpversion:file:setup.py]
search = version="{current_version}"
replace = version="{new_version}"
21 changes: 2 additions & 19 deletions .github/workflows/linters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,5 @@ name: Lint Python
on: [push]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pydocstyle
- name: Docstyle linting
run: |
pydocstyle --convention=google --add-ignore=D200,D210,D212,D415
call-run-python-linters:
uses: openclimatefix/.github/.github/workflows/python-lint.yml@main
35 changes: 0 additions & 35 deletions .github/workflows/main.yaml

This file was deleted.

10 changes: 10 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Bump version and auto-release
on:
push:
branches:
- main
jobs:
call-run-python-release:
uses: openclimatefix/.github/.github/workflows/python-release.yml@main
secrets:
token: ${{ secrets.PYPI_API_TOKEN }}
28 changes: 3 additions & 25 deletions .github/workflows/workflows.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,6 @@
name: Tests
name: Python package

on: [push]

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

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Install package
run: |
pip install -e .
- name: Test with pytest
run: |
pytest
call-run-python-tests:
uses: openclimatefix/.github/.github/workflows/python-test.yml@main

0 comments on commit 01ee780

Please sign in to comment.