Skip to content

Commit 27724f0

Browse files
authored
fix(ci): use new caching for all stages, fix sha tool to work on both linux & mac (#1741)
1 parent bc416ff commit 27724f0

File tree

3 files changed

+19
-21
lines changed

3 files changed

+19
-21
lines changed

.github/workflows/ci-experimental.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565
- name: Get submodules hash
6666
id: submodules
6767
run: |
68-
echo "hash=$(git submodule status | sha256sum | sed 's/[ -]*//g')" >> $GITHUB_OUTPUT
68+
echo "hash=$(git submodule status | awk '{print $1}' | sort | shasum -a 256 | sed 's/[ -]*//g')" >> $GITHUB_OUTPUT
6969
7070
- name: Cache submodules
7171
uses: actions/cache@v3
@@ -95,7 +95,7 @@ jobs:
9595
- name: Get submodules hash
9696
id: submodules
9797
run: |
98-
echo "hash=$(git submodule status | sha256sum | sed 's/[ -]*//g')" >> $GITHUB_OUTPUT
98+
echo "hash=$(git submodule status | awk '{print $1}' | sort | shasum -a 256 | sed 's/[ -]*//g')" >> $GITHUB_OUTPUT
9999
100100
- name: Cache submodules
101101
uses: actions/cache@v3

.github/workflows/ci.yml

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -70,20 +70,19 @@ jobs:
7070
steps:
7171
- name: Checkout code
7272
uses: actions/checkout@v3
73-
with:
74-
submodules: recursive
7573

76-
- name: Get submodules versions
74+
- name: Get submodules hash
7775
id: submodules
78-
shell: bash
7976
run: |
80-
echo "nim-hash=$(git rev-parse HEAD:vendor/nimbus-build-system)" >> $GITHUB_OUTPUT
77+
echo "hash=$(git submodule status | awk '{print $1}' | sort | shasum -a 256 | sed 's/[ -]*//g')" >> $GITHUB_OUTPUT
8178
82-
- name: Cache nim
79+
- name: Cache submodules
8380
uses: actions/cache@v3
8481
with:
85-
path: vendor/nimbus-build-system/vendor/Nim/bin
86-
key: ${{ runner.os }}-nim-${{ steps.submodules.outputs.nim-hash }}
82+
path: |
83+
vendor/
84+
.git/modules
85+
key: ${{ runner.os }}-vendor-modules-${{ steps.submodules.outputs.hash }}
8786

8887
- name: Build binaries
8988
run: make V=1 LOG_LEVEL=DEBUG QUICK_AND_DIRTY_COMPILER=1 v2 tools
@@ -101,20 +100,19 @@ jobs:
101100
steps:
102101
- name: Checkout code
103102
uses: actions/checkout@v3
104-
with:
105-
submodules: recursive
106103

107-
- name: Get submodules versions
104+
- name: Get submodules hash
108105
id: submodules
109-
shell: bash
110106
run: |
111-
echo "nim-hash=$(git rev-parse HEAD:vendor/nimbus-build-system)" >> $GITHUB_OUTPUT
107+
echo "hash=$(git submodule status | awk '{print $1}' | sort | shasum -a 256 | sed 's/[ -]*//g')" >> $GITHUB_OUTPUT
112108
113-
- name: Cache nim
109+
- name: Cache submodules
114110
uses: actions/cache@v3
115111
with:
116-
path: vendor/nimbus-build-system/vendor/Nim/bin
117-
key: ${{ runner.os }}-nim-${{ steps.submodules.outputs.nim-hash }}
112+
path: |
113+
vendor/
114+
.git/modules
115+
key: ${{ runner.os }}-vendor-modules-${{ steps.submodules.outputs.hash }}
118116

119117
- name: Run tests
120118
run: make V=1 LOG_LEVEL=DEBUG QUICK_AND_DIRTY_COMPILER=1 test2 testwakunode2
@@ -137,7 +135,7 @@ jobs:
137135
- name: Get submodules hash
138136
id: submodules
139137
run: |
140-
echo "hash=$(git submodule status | sha256sum | sed 's/[ -]*//g')" >> $GITHUB_OUTPUT
138+
echo "hash=$(git submodule status | awk '{print $1}' | sort | shasum -a 256 | sed 's/[ -]*//g')" >> $GITHUB_OUTPUT
141139
142140
- name: Cache submodules
143141
uses: actions/cache@v3
@@ -167,7 +165,7 @@ jobs:
167165
- name: Get submodules hash
168166
id: submodules
169167
run: |
170-
echo "hash=$(git submodule status | sha256sum | sed 's/[ -]*//g')" >> $GITHUB_OUTPUT
168+
echo "hash=$(git submodule status | awk '{print $1}' | sort | shasum -a 256 | sed 's/[ -]*//g')" >> $GITHUB_OUTPUT
171169
172170
- name: Cache submodules
173171
uses: actions/cache@v3

.github/workflows/release-assets.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- name: Get submodules hash
2828
id: submodules
2929
run: |
30-
echo "hash=$(git submodule status | sha256sum | sed 's/[ -]*//g')" >> $GITHUB_OUTPUT
30+
echo "hash=$(git submodule status | awk '{print $1}' | sort | shasum -a 256 | sed 's/[ -]*//g')" >> $GITHUB_OUTPUT
3131
3232
- name: Cache submodules
3333
uses: actions/cache@v3

0 commit comments

Comments
 (0)