Skip to content

Commit 11179f6

Browse files
committed
chore(ci): Debug hash check
1 parent b279ec7 commit 11179f6

File tree

2 files changed

+61
-5
lines changed

2 files changed

+61
-5
lines changed

.github/actions/install-tiledb/action.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,9 @@ runs:
181181
found_sha256 = digest.hexdigest()
182182
183183
if found_sha256 != expected_sha256:
184-
print("SHA256 hashes don't match. Found: {}, Expected {}".format(found_sha256, expected_sha256))
184+
print("SHA256 hashes don't match!")
185+
print("Expected: '{!r}'".format(expected_sha256))
186+
print("Found: '{!r}'".format(foun_sha256))
185187
exit(1)
186188
187189
with open(os.environ["GITHUB_OUTPUT"], 'w') as handle:

.github/workflows/pr-ci.yml

+58-4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ concurrency:
1414
group: ${{ github.head_ref || github.run_id }}
1515
cancel-in-progress: true
1616

17+
permissions:
18+
issues: write
19+
pull-requests: write
20+
1721
jobs:
1822
build-and-test:
1923
name: "Build and Test"
@@ -83,10 +87,60 @@ jobs:
8387
uses: Swatinem/rust-cache@v2
8488
- name: Install TileDB
8589
uses: ./.github/actions/install-tiledb
86-
- name: Check Formatting
87-
run: cargo fmt --quiet --check
88-
- name: Lint
89-
run: cargo clippy --no-deps --all-targets --all-features -- -Dwarnings
90+
- name: Check Formatting and Clippy
91+
id: lints
92+
env:
93+
GITHUB_OS: ${{ matrix.os }}
94+
shell: python
95+
run: |
96+
# Checking formatting and clippy
97+
import json
98+
import os
99+
import subprocess as sp
100+
101+
fmt = sp.run(["cargo", "fmt", "--quiet", "--check"])
102+
clippy = sp.run([
103+
'cargo',
104+
'clippy',
105+
'--workspace',
106+
'--all-targets',
107+
'--all-features',
108+
'--',
109+
'-Dwarnings'
110+
])
111+
112+
if fmt.returncode == 0 and clippy.returncode == 0:
113+
exit(0)
114+
115+
msg = [
116+
"# Rust +Nightly Check Failures - {}".format(os.environ["GITHUB_OS"]),
117+
""
118+
]
119+
if fmt.returncode == 0:
120+
msg.append("* ✅ Formatting Check Succeeded")
121+
else:
122+
msg.append("* ❌ Formatting Check Failed")
123+
if clippy.returncode == 0:
124+
msg.append("* ✅ Clippy Check Succeeded")
125+
else:
126+
msg.append("* ❌ Clippy Check Failed")
127+
msg.append("")
128+
129+
msg = json.dumps("\n".join(msg))
130+
131+
with open(os.environ["GITHUB_OUTPUT"], "wb") as handle:
132+
handle.write("message={}\n".format(msg).encode("utf-8"))
133+
- uses: actions/github-script@v7
134+
if: ${{ steps.lints.outputs.message }}
135+
with:
136+
github-token: ${{secrets.GITHUB_TOKEN}}
137+
script: |
138+
github.rest.issues.createComment({
139+
issue_number: context.issue.number,
140+
owner: context.repo.owner,
141+
repo: context.repo.repo,
142+
body: ${{ steps.lints.outputs.message }}
143+
})
90144
91145
check-pr-title:
92146
name: "Check Title Format"

0 commit comments

Comments
 (0)