Skip to content

Commit

Permalink
OPS-4995 update GHA (#6)
Browse files Browse the repository at this point in the history
* OPS-4995 update backup action

* OPS-4995 update checkout action

* OPS-4995 add CODEOWNERS

* OPS-4995 add dependabot settings

* OPS-4995 add release drafter

* OPS-4995 update pypi action

* OPS-4995 fix issues with python lint containers
  • Loading branch information
snovikov authored Jan 3, 2023
1 parent c0de83e commit bae70b6
Show file tree
Hide file tree
Showing 17 changed files with 86 additions and 30 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @Flaconi/devops
9 changes: 9 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: weekly
day: monday
time: "08:00"
timezone: Europe/Berlin
24 changes: 24 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Configuration for Release Drafter: https://github.com/toolmantim/release-drafter
name-template: '$NEXT_MINOR_VERSION 🌈'
tag-template: '$NEXT_MINOR_VERSION'
categories:
- title: '🚀 Features'
labels:
- feature
- enhancement
- title: '🐛 Bug Fixes'
labels:
- fix
- bugfix
- bug
- title: '🧰 Maintenance'
labels:
- chore
- dependencies
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
branches:
- master
template: |
## What's Changed
$CHANGES
10 changes: 2 additions & 8 deletions .github/workflows/backups.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
---

name: Backup Github Respository

# -------------------------------------------------------------------------------------------------
# When to run
# -------------------------------------------------------------------------------------------------
name: Backup Repository

on:
push:
Expand All @@ -13,11 +8,10 @@ on:

jobs:
backup:
uses: Flaconi/github-reusable-workflow/.github/workflows/backups.yml@stable
uses: Flaconi/github-reusable-workflow/.github/workflows/backups.yml@v1
with:
enabled: True
region: eu-central-1
secrets:
iam_role_arn: ${{ secrets.BACKUP_REPO_IAM_ROLE }}
bucket_name: ${{ secrets.BACKUP_REPO_BUCKET }}
git_read_token: ${{ secrets.REPO_READ_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/building.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
name: "[${{ matrix.version }}]"
steps:
- name: Checkout repository
uses: actions/checkout@master
uses: actions/checkout@v3

- name: Build source distribution
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/code-bandit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
name: "[ ${{ matrix.target }} ]"
steps:
- name: Checkout repository
uses: actions/checkout@master
uses: actions/checkout@v3

- name: "${{ matrix.target }}"
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/code-black.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
name: "[ ${{ matrix.target }} ]"
steps:
- name: Checkout repository
uses: actions/checkout@master
uses: actions/checkout@v3

- name: "${{ matrix.target }}"
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/code-mypy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
name: "[ ${{ matrix.target }} ]"
steps:
- name: Checkout repository
uses: actions/checkout@master
uses: actions/checkout@v3

- name: "${{ matrix.target }}"
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/code-pycodestyle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
name: "[ ${{ matrix.target }} ]"
steps:
- name: Checkout repository
uses: actions/checkout@master
uses: actions/checkout@v3

- name: "${{ matrix.target }}"
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/code-pydocstyle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
name: "[ ${{ matrix.target }} ]"
steps:
- name: Checkout repository
uses: actions/checkout@master
uses: actions/checkout@v3

- name: "${{ matrix.target }}"
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/code-pylint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
name: "[ ${{ matrix.target }} ]"
steps:
- name: Checkout repository
uses: actions/checkout@master
uses: actions/checkout@v3

- name: "${{ matrix.target }}"
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
name: docker
steps:
- name: Checkout repository
uses: actions/checkout@master
uses: actions/checkout@v3

- name: Set variables
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
name: "[ ${{ matrix.target }} ]"
steps:
- name: Checkout repository
uses: actions/checkout@master
uses: actions/checkout@v3

- name: Lint files
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:
name: pypi
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up Python 3.8
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: 3.8

Expand All @@ -31,7 +31,7 @@ jobs:

# Only on git Tag in our own repository
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@master
uses: pypa/gh-action-pypi-publish@v1.6.4
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: Release Drafter

on:
push:
branches:
- master

permissions:
contents: write
pull-requests: write

jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
name: "[${{ matrix.version }}]"
steps:
- name: Checkout repository
uses: actions/checkout@master
uses: actions/checkout@v3

- name: Build source distribution
run: |
Expand Down
27 changes: 18 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ endif
# -------------------------------------------------------------------------------------------------
# This can be adjusted
PYTHON_VERSION = 3.8

PYLINT_VERSION = latest-0.6
MYPY_VERSION = latest-0.4

# -------------------------------------------------------------------------------------------------
# Default configuration
Expand Down Expand Up @@ -176,9 +177,13 @@ _code-pylint:
@echo "# -------------------------------------------------------------------- #"
@echo "# Check pylint"
@echo "# -------------------------------------------------------------------- #"
docker run --rm $$(tty -s && echo "-it" || echo) -v $(PWD):/data --entrypoint=sh cytopia/pylint -c '\
pip3 install -r requirements.txt \
&& pylint --rcfile=setup.cfg $(SRC)/'
docker run --rm $$(tty -s && echo "-it" || echo) \
--network=host \
-v $(PWD):/data \
--entrypoint=sh \
cytopia/pylint:$(PYLINT_VERSION) -c '\
pip3 install -r requirements.txt \
&& pylint --rcfile=setup.cfg $(SRC)/'

.PHONY: _code-black
_code-black:
Expand All @@ -199,11 +204,15 @@ _code-mypy:
@echo "# -------------------------------------------------------------------- #"
@echo "# Check mypy"
@echo "# -------------------------------------------------------------------- #"
docker run --rm $$(tty -s && echo "-it" || echo) -v ${PWD}:/data --entrypoint=sh cytopia/mypy -c ' \
python -m pip install -r requirements.txt \
&& yes | mypy --config-file setup.cfg --install-types $(SRC)/ 2>&1 >/dev/null \
&& mypy --config-file setup.cfg $(SRC)/ \
'
docker run --rm $$(tty -s && echo "-it" || echo) \
--network=host \
-v ${PWD}:/data \
--entrypoint=sh \
cytopia/mypy:$(MYPY_VERSION) -c ' \
python -m pip install -r requirements.txt \
&& yes | mypy --config-file setup.cfg --install-types $(SRC)/ 2>&1 >/dev/null \
&& mypy --config-file setup.cfg $(SRC)/ \
'


# -------------------------------------------------------------------------------------------------
Expand Down

0 comments on commit bae70b6

Please sign in to comment.