-
Notifications
You must be signed in to change notification settings - Fork 590
68 lines (54 loc) · 1.95 KB
/
Copy pathpip-compile.yaml
File metadata and controls
68 lines (54 loc) · 1.95 KB
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
name: Pip Compile
on:
pull_request:
branches:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
pip-compile:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
ref: ${{ github.head_ref || github.ref_name }} # Check out the PR branch
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.13'
- name: Cache .mypy_cache
uses: actions/cache@v4
with:
path: .mypy_cache
key: mypy-cache-${{ runner.os }}-${{ hashFiles('**/*.py', 'pyproject.toml') }}
- name: Pin pip to <25.0 for pip-tools compatibility
run: pip install "pip<25.0"
- name: Install Pip Tools
run: pip install -U pip-tools
- name: Run Pip Compile
run: pip-compile -U --no-strip-extras
- name: Run Pip Compile for Windows
run: pip-compile -U requirements-windows.in --no-strip-extras
- name: Run Pip Compile for Dev Deps
run: pip-compile -U requirements-dev.in --no-strip-extras
- name: Run Pip Compile for Docs Deps
run: pip-compile -U requirements-docs.in --no-strip-extras
- name: Check for changes
id: changes
run: |
if [[ -n $(git status --porcelain) ]]; then
echo "changes_detected=true" >> $GITHUB_ENV
else
echo "changes_detected=false" >> $GITHUB_ENV
fi
- name: Commit changes
if: env.changes_detected == 'true' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository)
run: |
git config --local user.name "github-actions[bot]"
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git add .
git commit -m "chore: \`pip-compile\`"
git push