Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c7607b9

Browse filesBrowse files
Trottaduh95
authored andcommitted
tools: automate updates for test/fixtures/test426
PR-URL: #60978 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
1 parent 5dd48e3 commit c7607b9
Copy full SHA for c7607b9

2 files changed

+38Lines changed: 38 additions & 0 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎.github/workflows/tools.yml‎

Copy file name to clipboardExpand all lines: .github/workflows/tools.yml
+9Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ on:
3737
- root-certificates
3838
- simdjson
3939
- sqlite
40+
- test426-fixtures
4041
- undici
4142
- uvwasi
4243
- zlib
@@ -243,6 +244,14 @@ jobs:
243244
cat temp-output
244245
tail -n1 temp-output | grep "NEW_VERSION=" >> "$GITHUB_ENV" || true
245246
rm temp-output
247+
- id: test426-fixtures
248+
subsystem: test
249+
label: test
250+
run: |
251+
bash tools/dep_updaters/update-test426-fixtures.sh > temp-output
252+
cat temp-output
253+
tail -n1 temp-output | grep "NEW_VERSION=" >> "$GITHUB_ENV" || true
254+
rm temp-output
246255
- id: undici
247256
subsystem: deps
248257
label: dependencies
Collapse file
+29Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/sh
2+
3+
set -ex
4+
5+
BASE_DIR=$(cd "$(dirname "$0")/../.." && pwd)
6+
7+
TARGET_DIR="$BASE_DIR/test/fixtures/test426"
8+
README="$BASE_DIR/test/test426/README.md"
9+
TARBALL_URL=$(curl -fsIo /dev/null -w '%header{Location}' https://github.com/tc39/source-map-tests/archive/HEAD.tar.gz)
10+
SHA=$(basename "$TARBALL_URL")
11+
12+
CURRENT_SHA=$(sed -n 's#^.*https://github.com/tc39/source-map-tests/commit/\([0-9a-f]*\).*$#\1#p' "$README")
13+
14+
if [ "$CURRENT_SHA" = "$SHA" ]; then
15+
echo "Already up-to-date"
16+
exit 0
17+
fi
18+
19+
rm -rf "$TARGET_DIR"
20+
mkdir "$TARGET_DIR"
21+
curl -f "$TARBALL_URL" | tar -xz --strip-components 1 -C "$TARGET_DIR"
22+
23+
TMP_FILE=$(mktemp)
24+
sed "s/$CURRENT_SHA/$SHA/" "$README" > "$TMP_FILE"
25+
mv "$TMP_FILE" "$README"
26+
27+
# The last line of the script should always print the new version,
28+
# as we need to add it to $GITHUB_ENV variable.
29+
echo "NEW_VERSION=$SHA"

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.