Skip to content

Commit b6f79f5

Browse files
chore: Create submodule CI check (#5582)
* Create submodule.yml * Update submodule.yml * Update submodule.yml * Update submodule.yml * Update submodule.yml * Update and rename submodule.yml to check_submodule.yml * Update CODEOWNERS * Update check_submodule.yml * Update .github/workflows/check_submodule.yml Co-authored-by: Severin Siffert <[email protected]> * fix motoko sub version * fix sdk sub version * fix sub versions * Update check_submodule.yml * fix subs * Update MOTOKO_MAINTENANCE.md --------- Co-authored-by: Severin Siffert <[email protected]>
1 parent 4283342 commit b6f79f5

File tree

6 files changed

+74
-4
lines changed

6 files changed

+74
-4
lines changed

.github/CODEOWNERS

+6
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ docs/other/updates/release-notes/ @dfinity/dx
88
docs/building-apps/interact-with-canisters/agents/ @dfinity/dx
99
docs/building-apps/developer-tools/cdks/ @dfinity/dx
1010

11+
# SDK
12+
submodules/sdk @dfinity/sdk
13+
14+
# Motoko
15+
submodules/motoko @dfinity/languages
16+
1117
# FI
1218
docs/defi/ @dfinity/finint
1319

.github/workflows/check_submodule.yml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Validate Submodule Commits
2+
on:
3+
pull_request:
4+
branches:
5+
- master
6+
7+
jobs:
8+
submodule-commit-check:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout repository
12+
uses: actions/checkout@v4
13+
with:
14+
submodules: recursive
15+
fetch-depth: 0
16+
17+
- name: Validate Submodule Commits
18+
run: |
19+
# Submodules are very easy to accidentally overwrite with old versions.
20+
# To make submodule updates more explicit and to prevent accidental changes we check the revisions explicitly here.
21+
22+
# dfx 0.25.1
23+
LATEST_SDK="1fbe1537b0ac988c20ca447bee3a3750601f1294"
24+
25+
# motoko 0.14.5
26+
LATEST_MOTOKO="51fa74671829c59912c37500773cfaba950b0a1b"
27+
28+
# Get current submodule commits
29+
SDK_HASH=$(git submodule status submodules/sdk | awk '{print $1}')
30+
MOTOKO_HASH=$(git submodule status submodules/motoko | awk '{print $1}')
31+
32+
# Validate SDK commit
33+
if [[ "$SDK_HASH" != "$LATEST_SDK"* ]]; then
34+
echo "Error: SDK submodule is not on the latest release commit"
35+
exit 1
36+
fi
37+
38+
# Validate Motoko commit
39+
if [[ "$MOTOKO_HASH" != "$LATEST_MOTOKO"* ]]; then
40+
echo "Error: Motoko submodule is not on the latest release commit"
41+
exit 1
42+
fi
43+
44+
echo "All submodules are on their latest release commits"

MOTOKO_MAINTENANCE.md

+3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ git checkout 0.14.1 #or whatever new tag you desire
88
cd ../..
99
git add submodules/motoko # add the change to the submodule
1010
```
11+
12+
Update the `.github/workflows/check_submodule.yml` file to reflect the latest version's commit hash.
13+
1114
Replace `static/moc-interpreter-0.14.0.js` with `static/moc_interpreter-0.14.1.js` downloaded from the Motoko release page.
1215

1316
Edit `static/load_moc.ts` to use the correct version of the interpreter and base libs.

README.md

+19-2
Original file line numberDiff line numberDiff line change
@@ -406,10 +406,27 @@ The following submodules and their corresponding repos are currently used:
406406
407407
### Updating submodules
408408
409-
To update all submodules, run the command:
409+
The SDK and Motoko submodules must be on the latest release version for their respective package release, i.e., IC SDK v0.25.1 or Motoko v0.14.5. These versions are checked by the Check Submodule CI job.
410+
411+
These versions can be updated to the newest release via commands:
412+
413+
```
414+
cd submodules/motoko
415+
git checkout 0.14.1
416+
```
417+
418+
and
419+
420+
```
421+
cd submodules/sdk
422+
git checkout 0.25.1
423+
```
424+
425+
For other submodules without release versions, checkout the latest commit hash when updates are requested.
410426
411427
```
412-
git submodule update --remote
428+
cd submodules/dfxvm
429+
git checkout 69adb0cc8edd532dcdcb465cfcc2166692a51448
413430
```
414431
415432
### Reverting submodule changes

submodules/sdk

Submodule sdk updated 129 files

0 commit comments

Comments
 (0)