-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New workflow for updating `requirements.txt`. The new workflow will be scheduled to run every Monday. Dependabot now only checks the Python dependencies for the development requirements (`requirements_dev.txt`), which needed to be moved to a separate folder for this to work (`/.dev`).
- Loading branch information
Showing
9 changed files
with
111 additions
and
9 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
aioredis | ||
fastapi | ||
fastapi_plugins | ||
hypercorn | ||
oteapi-core | ||
pydantic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
### Update `requirements.txt` | ||
|
||
Automatically created PR from the [`ci_update_requirements.yml` workflow](https://github.com/EMMC-ASBL/oteapi-services/blob/master/.github/workflows/ci_update_requirements.yml). | ||
|
||
#### To-do | ||
|
||
- [ ] Check that the diff is sensible, and that tests and builds pass with the new dependency versions. | ||
- [ ] Make sure that the PR is **squash** merged, with a sensible commit message. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
name: CI - Check for updates to `requirements.txt` | ||
|
||
on: | ||
schedule: | ||
# At 7:30 every Monday (6:30 UTC) | ||
- cron: "30 6 * * 1" | ||
|
||
env: | ||
DEPENDABOT_BRANCH: ci/dependabot-updates | ||
GIT_USER_NAME: "TEAM 4.0[bot]" | ||
GIT_USER_EMAIL: "Team4.0@SINTEF.no" | ||
|
||
jobs: | ||
update-requirements: | ||
name: Update `requirements.txt` | ||
if: github.repository_owner == 'EMMC-ASBL' | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ env.DEPENDABOT_BRANCH }} | ||
fetch-depth: 0 | ||
|
||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
|
||
- name: Set up git config | ||
run: | | ||
git config --global user.name "${{ env.GIT_USER_NAME }}" | ||
git config --global user.email "${{ env.GIT_USER_EMAIL }}" | ||
- name: Install immediate requirements | ||
run: | | ||
python -m pip install -U pip | ||
pip install -U setuptools wheel | ||
pip install --no-cache-dir --upgrade-strategy=eager -U -r .github/utils/direct_requirements.txt | ||
- name: Run `pip freeze` and update current `requirements.txt` | ||
run: | | ||
pip freeze > requirements_new.txt | ||
if [ "$(diff requirements.txt requirements_new.txt)" ]; then | ||
# There are updates ! | ||
mv -f requirements_new.txt requirements.txt | ||
echo -e "requirements.txt has been updated. Diff:\n$(git diff requirements.txt)" | ||
echo "UPDATE_DEPS=true" >> $GITHUB_ENV | ||
git add requirements.txt | ||
git commit -m "Update \`requirements.txt\`" | ||
else | ||
# No changes | ||
echo "No changes found for requirements.txt." | ||
echo "UPDATE_DEPS=false" >> $GITHUB_ENV | ||
fi | ||
- name: Fetch PR body | ||
if: env.UPDATE_DEPS == 'true' | ||
id: pr_body | ||
uses: chuhlomin/render-template@v1.4 | ||
with: | ||
template: .github/utils/requirements_update_pr_body.txt | ||
|
||
- name: Create PR | ||
if: env.UPDATE_DEPS == 'true' | ||
id: cpr | ||
uses: peter-evans/create-pull-request@v3 | ||
with: | ||
token: ${{ secrets.RELEASE_PAT }} | ||
commit-message: "Update `requirements.txt`" | ||
committer: "${{ env.GIT_USER_NAME }} <${{ env.GIT_USER_EMAIL }}>" | ||
author: "${{ env.GIT_USER_NAME }} <${{ env.GIT_USER_EMAIL }}>" | ||
branch: ci/update-requirements | ||
delete-branch: true | ||
title: "[Auto-generated] Update `requirements.txt`" | ||
body: ${{ steps.pr_body.outputs.result }} | ||
labels: CI/CD | ||
|
||
- name: Information | ||
if: env.UPDATE_DEPS == 'true' | ||
run: 'echo "${{ steps.cpr.outputs.pull-request-operation }} PR #${{ steps.cpr.outputs.pull-request-number }}: ${{ steps.cpr.outputs.pull-request-url }}"' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters