Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .github/workflows/Comment-on-PR.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
on:
pull_request_target:
paths:
- '*'
- '!docs/Coding-Conventions.md'
- "*"
- "!docs/Coding-Conventions.md"
types:
- opened
- reopened

jobs:
comment_on_pr:
Expand All @@ -11,7 +14,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Comment on PR
uses: thollander/actions-comment-pull-request@v1
with:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/Notify-Convention-Change.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
pull_request_target:
paths:
- docs/Coding-Conventions.md
types:
- opened
- reopened

jobs:
org-check:
Expand Down
14 changes: 5 additions & 9 deletions .github/workflows/PR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
- .github/workflows/PR.yml

env:
POETRY_VERSION: 1.1.6
POETRY_VERSION: 1.2.2

jobs:
checks:
Expand All @@ -24,18 +24,14 @@ jobs:
- uses: actions/setup-python@v2
with:
python-version: ${{ env.PYTHON_VERSION }}
- uses: Gr1N/setup-poetry@v4
- uses: Gr1N/setup-poetry@v8
with:
poetry-version: ${{ env.POETRY_VERSION }}
# @TODO: This is a workaround for there not being a way to check the lock file
# See: https://github.com/python-poetry/poetry/issues/453
- name: Check for lock changes
run: |
PYTHONPATH="${PYTHONPATH}:${HOME}/.poetry/lib:${HOME}/.poetry/lib/poetry/_vendor/py${{ env.PYTHON_VERSION }}" \
python -c "from poetry.factory import Factory; \
locker = Factory().create_poetry('.').locker; \
exit(0) if locker.is_locked() and locker.is_fresh() else exit(1)" \
&& echo 'OK'
poetry lock --check
- uses: actions/cache@v2
with:
path: ~/.cache/pypoetry/virtualenvs
Expand All @@ -50,14 +46,14 @@ jobs:
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
python-version: [3.7, 3.8, 3.9]
python-version: [3.7, 3.8, 3.9, '3.10', '3.11']
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- uses: Gr1N/setup-poetry@v4
- uses: Gr1N/setup-poetry@v8
with:
poetry-version: ${{ env.POETRY_VERSION }}
- uses: actions/cache@v2
Expand Down
15 changes: 6 additions & 9 deletions .github/workflows/Publish-Package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

env:
# Versions are also listed in PR.yml
POETRY_VERSION: 1.1.6
POETRY_VERSION: 1.2.2
PYTHON_VERSION: 3.9 # Use latest

jobs:
Expand All @@ -23,18 +23,14 @@ jobs:
- uses: actions/setup-python@v2
with:
python-version: ${{ env.PYTHON_VERSION }}
- uses: Gr1N/setup-poetry@v4
- uses: Gr1N/setup-poetry@v8
with:
poetry-version: ${{ env.POETRY_VERSION }}
# @TODO: This is a workaround for there not being a way to check the lock file
# See: https://github.com/python-poetry/poetry/issues/453
- name: Check for lock changes
run: |
PYTHONPATH="${PYTHONPATH}:${HOME}/.poetry/lib:${HOME}/.poetry/lib/poetry/_vendor/py${{ env.PYTHON_VERSION }}" \
python -c "from poetry.factory import Factory; \
locker = Factory().create_poetry('.').locker; \
exit(0) if locker.is_locked() and locker.is_fresh() else exit(1)" \
&& echo 'OK'
poetry lock --check
- uses: actions/cache@v2
with:
path: ~/.cache/pypoetry/virtualenvs
Expand Down Expand Up @@ -71,7 +67,8 @@ jobs:

- name: Push changes
if: ${{ github.event.release.target_commitish == 'main' }}
uses: ad-m/github-push-action@master
uses: CasperWA/push-protected@v2
with:
github_token: ${{ secrets.ADMIN_PAT }}
token: ${{ secrets.ADMIN_PAT }}
branch: ${{ github.event.release.target_commitish }}
unprotect_reviews: true
45 changes: 45 additions & 0 deletions .github/workflows/Update-Poetry-Lock.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Update Poetry lock on a regular basis

on:
schedule:
- cron: '0 4 * * 0' # weekly at 04:00 on Sunday -> https://crontab.guru/#0_4_*_*_0

env:
# Versions are also listed in PR.yml
POETRY_VERSION: 1.1.15 # keeping this one back for now until 1.2 becomes the standard for devs
PYTHON_VERSION: 3.9 # Use latest

jobs:
update_poetry_lock:
name: Update Poetry Lock
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: main # This is the branch the PR is to be created from
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo

- uses: actions/setup-python@v2
with:
python-version: ${{ env.PYTHON_VERSION }}
- uses: Gr1N/setup-poetry@v8
with:
poetry-version: ${{ env.POETRY_VERSION }}
- name: Check for lock changes
run: |
poetry lock
poetry install
poetry run ni-python-styleguide fix
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
commit-message: Update poetry lock and reformat
title: Update Poetry Lock
branch: aotumated-updates/update-poetry-lock
branch-suffix: short-commit-hash
body: |
# Update Poetry Lock
Ran poetry lock, install, then ni-python-styleguide fix to reformat any changes.
base: main
delete-branch: true