-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (64 loc) · 2.44 KB
/
update-requirements.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
---
name: Update requirements.txt
permissions:
contents: write
on: # yamllint disable-line rule:truthy
pull_request:
branches:
- main
paths:
- "pyproject.toml"
- "poetry.lock"
jobs:
update_requirements:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install FFTW
run: sudo apt-get update && sudo apt-get install -y libfftw3-dev
- name: Install dependencies
run: python -m pip install --upgrade poetry
- name: Install project dependencies
run: python -m poetry update
- name: Update requirements.txt
run: python -m poetry export --format requirements.txt --output requirements.txt --extras healpy_support --extras pytorch_support --without-hashes
- name: Update requirements-dev.txt
run: python -m poetry export --with dev --format requirements.txt --output requirements-dev.txt --without-hashes
- name: Prepare commit
run: sudo chown -Rc $UID .git/
# Create Pull Request step
- name: Create Pull Request with applied fixes
id: cpr
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
commit-message: "Updated requirements.txt and requirements-dev.txt"
title: "Update requirements"
branch: update-requirements
labels: bot
base: main
# Output PR details
- name: Create PR output
run: |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
# Push new commit if applicable (for now works only on PR from same repository, not from forks)
- name: Prepare commit
run: sudo chown -Rc $UID .git/
- name: Commit and push applied linter fixes
uses: stefanzweifel/git-auto-commit-action@v4
with:
branch: ${{ github.event.pull_request.head.ref || github.head_ref || github.ref }}
commit_message: "Update requirements.txt and requirements-dev.txt"
commit_user_name: requirements-bot
commit_user_email: [email protected]