-
Notifications
You must be signed in to change notification settings - Fork 22
71 lines (67 loc) · 2.48 KB
/
daily-regression.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
name: Chisel and CIRCT Bump
on:
schedule:
# Run this job everyday at 5:30 AM UTC+8
- cron: '30 21 * * *'
jobs:
bump-deps:
name: "Bump Chisel and CIRCT"
if: ${{ !cancelled() }}
runs-on: [self-hosted, linux, nixos]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: master
- name: Bump Chisel
run: |
cd nix/t1
nix run '.#nvfetcher' -- -f '^chisel$'
- name: Bump circt
run: |
oldFirtool="$(nix build '.#circt' --no-link --print-out-paths)/bin/firtool"
nix flake update nixpkgs-for-circt
newFirtool="$(nix build '.#circt' --no-link --print-out-paths)/bin/firtool"
diff_bin="$(nix build '.#diffutils' --no-link --print-out-paths)/bin/diff"
if "$diff_bin" -u <($oldFirtool --version) <($newFirtool --version); then
# if unchanged
git restore flake.lock
fi
- name: Bump all mill deps
run: |
oldHash=$(nix derivation show .#t1.elaborator.millDeps | jq -r 'to_entries[0].value.env.outputHash')
nix build '.#t1.elaborator.millDeps' --rebuild > t1-milldeps-log.txt 2>&1 || true
newHash=$(cat t1-milldeps-log.txt \
| grep -P '^\s+got:\s+sha256-.*$' \
| cut -d':' -f2 \
| xargs)
if [ -z "$newHash" ] || [ "$newHash" = "$oldHash" ]; then
echo "Original build logs for debug: "
cat t1-milldeps-log.txt
echo "Hash unchanged, exit"
exit 0
fi
echo "Updating hash $oldHash to $newHash"
sed -i "s|$oldHash|$newHash|" nix/t1/t1.nix
- name: Commit changes
env:
GITHUB_TOKEN: ${{ secrets.T1_PR_PAT }}
run: |
git config user.name Avimitin
git config user.email [email protected]
currentDate=$(date +%F)
branch="dependencies-bumping-$currentDate"
git checkout -b "$branch"
git add 'nix/t1'
git add 'flake.lock'
fileUnchanged() {
git diff --quiet --exit-code "$@"
}
if ! git diff --quiet --cached --exit-code; then
updatedFiles=$(git diff --cached --name-only)
echo "File changed"
git commit -m "[deps] Bump T1 dependencies"
git push origin "$branch" --force-with-lease
nix run '.#gh' -- \
pr create --title "Bump T1 dependencies" --body "Updated: $updatedFiles"
fi