Skip to content

Commit f10a5e0

Browse files
committed
Initial commit
0 parents  commit f10a5e0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+13736
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Check linked issues
2+
3+
on:
4+
pull_request_target:
5+
types: [opened, edited, reopened, synchronize]
6+
7+
jobs:
8+
check_pull_requests:
9+
runs-on: ubuntu-latest
10+
name: Check linked issues
11+
permissions:
12+
issues: read
13+
pull-requests: write
14+
steps:
15+
- uses: nearform-actions/github-action-check-linked-issues@v1
16+
id: check-linked-issues
17+
with:
18+
exclude-branches: "release/**, dependabot/**, auto-dependency-upgrades"
19+
# OPTIONAL: Use the output from the `check-linked-issues` step
20+
- name: Get the output
21+
run: echo "How many linked issues? ${{ steps.check-linked-issues.outputs.linked_issues_count }}"

.github/workflows/pre-commit.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: pre-commit
2+
3+
on:
4+
pull_request:
5+
push:
6+
7+
jobs:
8+
pre-commit:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
- uses: actions/setup-python@v3
13+
with:
14+
python-version: "3.10"
15+
- uses: pre-commit/action@v3.0.0

.github/workflows/publish_docu.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: deploy_docu
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
deploy:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v3
15+
- uses: actions/setup-python@v4
16+
with:
17+
python-version: 3.x
18+
- uses: actions/cache@v4
19+
with:
20+
key: ${{ github.ref }}
21+
path: .cache
22+
- run: pip install mkdocs-material mkdocstrings[python] mike
23+
- run: mkdocs gh-deploy --force
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: test_and_deploy_docu
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
deploy:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v3
16+
- uses: actions/setup-python@v4
17+
with:
18+
python-version: 3.x
19+
- uses: actions/cache@v4
20+
with:
21+
key: ${{ github.ref }}
22+
path: .cache
23+
- run: pip install mkdocs-material mkdocstrings[python] mike
24+
- run: |
25+
if [ ${{ github.ref }} == "refs/heads/main" ]; then
26+
mkdocs gh-deploy --force
27+
else
28+
mkdocs build --strict
29+
fi
30+
shell: bash
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Test compliance of used licenses
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
pull_request:
8+
branches: [ "main" ]
9+
10+
jobs:
11+
run-tests:
12+
13+
runs-on: ubuntu-latest
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
python-version: ["3.10"]
18+
19+
steps:
20+
- uses: actions/checkout@v3
21+
- name: Set up Python ${{ matrix.python-version }}
22+
uses: actions/setup-python@v3
23+
with:
24+
python-version: ${{ matrix.python-version }}
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
python -m pip install -r requirements_dev.txt
29+
- name: Test licenses
30+
run: |
31+
make licenses

.github/workflows/test_package.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Run tests of python package
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
pull_request:
8+
branches: [ "main" ]
9+
10+
jobs:
11+
run-tests:
12+
13+
runs-on: ubuntu-latest
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
python-version: ["3.10", "3.11"]
18+
19+
steps:
20+
- uses: actions/checkout@v3
21+
- name: Set up Python ${{ matrix.python-version }}
22+
uses: actions/setup-python@v3
23+
with:
24+
python-version: ${{ matrix.python-version }}
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
python -m pip install -r requirements_dev.txt
29+
- name: Test with pytest
30+
run: |
31+
python -m pytest
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: check_version_update
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
jobs:
7+
build:
8+
name: Check Actions
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v1
12+
- name: Changelog check
13+
uses: Zomzog/changelog-checker@v1.2.0
14+
with:
15+
fileName: VERSION # default `CHANGELOG.adoc`
16+
noChangelogLabel: version not updated # default `no changelog`
17+
checkNotification: Simple # default `Detailed`
18+
env:
19+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# File: .github/workflows/upgrade-dependencies.yml
2+
name: Upgrade dependencies
3+
4+
# taken and adapted from https://www.oddbird.net/2022/06/01/dependabot-single-pull-request/#upgrade-python-dependencies
5+
6+
on:
7+
workflow_dispatch: # Allow running on-demand
8+
schedule:
9+
# Runs every Monday at 5:00 UTC
10+
- cron: '0 5 * * 1'
11+
12+
jobs:
13+
upgrade:
14+
name: Upgrade & Open Pull Request
15+
runs-on: ubuntu-latest
16+
env:
17+
# This branch will receive updates each time the workflow runs
18+
# It doesn't matter if it's deleted when merged, it'll be re-created
19+
BRANCH_NAME: auto-dependency-upgrades
20+
steps:
21+
- uses: actions/checkout@v3
22+
23+
# START PYTHON DEPENDENCIES
24+
- uses: actions/setup-python@v3
25+
with:
26+
python-version: "3.10"
27+
# cache: pip
28+
- name: Upgrade Python dependencies
29+
# ADD YOUR CUSTOM DEPENDENCY UPGRADE COMMANDS BELOW
30+
run: |
31+
python -m pip install -r requirements_dev.txt
32+
#pip-compile --upgrade -o requirements/prod.txt requirements/prod.in
33+
#pip-compile --upgrade -o requirements/dev.txt requirements/dev.in
34+
make update-requirements
35+
python -m pip install -r requirements_dev.txt
36+
make update-requirements
37+
# END PYTHON DEPENDENCIES
38+
39+
- name: Detect changes
40+
id: changes
41+
run:
42+
# This output boolean tells us if the dependencies have actually changed
43+
echo "count=$(git status --porcelain=v1 2>/dev/null | wc -l)" >> $GITHUB_OUTPUT
44+
- name: Commit & push changes
45+
# Only push if changes exist
46+
if: steps.changes.outputs.count > 0
47+
env:
48+
GITHUB_TOKEN: ${{ secrets.AUTOMATE_ISSUES }}
49+
run: |
50+
awk -F. -v OFS=. '{$NF += 1 ; print}' VERSION > tmp_VERSION.txt # Update version count
51+
cat tmp_VERSION.txt > VERSION # Update version count
52+
rm tmp_VERSION.txt # Update version count
53+
git config user.name github-actions
54+
git config user.email github-actions@github.com
55+
git add .
56+
git commit -m "Automated dependency upgrades"
57+
git push -f origin ${{ github.ref_name }}:$BRANCH_NAME
58+
- name: Open pull request if needed
59+
if: steps.changes.outputs.count > 0
60+
env:
61+
GITHUB_TOKEN: ${{ secrets.AUTOMATE_ISSUES }}
62+
# Only open a PR if the branch is not attached to an existing one
63+
run: |
64+
PR=$(gh pr list --head $BRANCH_NAME --json number -q '.[0].number')
65+
if [ -z $PR ]; then
66+
gh pr create \
67+
--head $BRANCH_NAME \
68+
--title "Automated dependency upgrades" \
69+
--body "Full log: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
70+
else
71+
echo "Pull request already exists, won't create a new one."
72+
fi

0 commit comments

Comments
 (0)