forked from smartbugs/oyente
-
Notifications
You must be signed in to change notification settings - Fork 2
164 lines (132 loc) Β· 4.46 KB
/
dependencies.yml
File metadata and controls
164 lines (132 loc) Β· 4.46 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
name: Dependency Updates
on:
schedule:
# Check for dependency updates weekly on Mondays at 8 AM UTC
- cron: '0 8 * * 1'
workflow_dispatch: # Allow manual trigger
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
env:
PYTHON_VERSION: '3.9'
CI: true
permissions:
contents: write # Push commits and tags
pull-requests: write # Create and update PRs
jobs:
dependency-update:
name: Update Dependencies
runs-on: ubuntu-22.04
timeout-minutes: 20
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Set up development environment
run: ./scripts/setup-venv.sh
- name: Check for outdated dependencies
id: check-deps
timeout-minutes: 5
run: |
source venv/bin/activate
# Get current dependency state
poetry show --outdated > outdated-before.txt || true
if [ -s outdated-before.txt ]; then
echo "has_updates=true" >> $GITHUB_OUTPUT
echo "π¦ Found outdated dependencies:"
cat outdated-before.txt
else
echo "has_updates=false" >> $GITHUB_OUTPUT
echo "β
All dependencies are up to date"
fi
- name: Update dependencies
if: steps.check-deps.outputs.has_updates == 'true'
timeout-minutes: 10
run: |
source venv/bin/activate
# Update dependencies while respecting version constraints
poetry update --dry-run > update-plan.txt
echo "π Update plan:"
cat update-plan.txt
# Perform the actual update
poetry update
# Show what was updated
poetry show --outdated > outdated-after.txt || true
- name: Test updated dependencies
if: steps.check-deps.outputs.has_updates == 'true'
timeout-minutes: 15
run: |
source venv/bin/activate
# Install with updated dependencies
poetry install --with dev
# Run quick validation using Makefile
make format
make lint
make type-check
make test-unit
- name: Generate update summary
if: steps.check-deps.outputs.has_updates == 'true'
run: |
cat > dependency-update-summary.md << 'EOF'
# Dependency Update Summary
## Updates Applied
The following dependencies have been updated:
### Before Update
```
EOF
if [ -f outdated-before.txt ]; then
cat outdated-before.txt >> dependency-update-summary.md
fi
cat >> dependency-update-summary.md << 'EOF'
```
### After Update
```
EOF
if [ -f outdated-after.txt ]; then
cat outdated-after.txt >> dependency-update-summary.md
else
echo "All dependencies are now up to date!" >> dependency-update-summary.md
fi
cat >> dependency-update-summary.md << 'EOF'
```
## Validation
- β
Code formatting check passed
- β
Linting passed
- β
Type checking passed
- β
Unit tests passed
This update has been automatically tested and is ready for review.
EOF
- name: Create Pull Request
if: steps.check-deps.outputs.has_updates == 'true'
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: |
chore: update dependencies
Automated dependency update with validation.
All tests pass with updated dependencies.
title: "chore: automated dependency updates"
body-path: dependency-update-summary.md
branch: automated-dependency-updates
delete-branch: true
labels: |
dependencies
automated
reviewers: |
zariliv
- name: Upload update artifacts
if: steps.check-deps.outputs.has_updates == 'true'
uses: actions/upload-artifact@v4
with:
name: dependency-update-report
path: |
outdated-before.txt
outdated-after.txt
update-plan.txt
dependency-update-summary.md