Skip to content

Commit c3da86d

Browse files
committed
Speedup CI: Cache make 4.4.1 compiled
Signed-off-by: Jiahao XU <[email protected]>
1 parent 799eacc commit c3da86d

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

.github/workflows/main.yml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,34 @@ jobs:
1717

1818
- run: cargo test
1919

20+
- name: Cache make compiled
21+
if: ${{ !startsWith(matrix.os, 'windows') }}
22+
id: cache-make
23+
uses: actions/cache@v4
24+
with:
25+
path: /usr/local/bin/make
26+
key: ${{ runner.os }}-make-4.4.1
27+
2028
# Compile it from source (temporarily)
2129
- name: Make GNU Make from source
22-
if: ${{ !startsWith(matrix.os, 'windows') }}
30+
if: ${{ !startsWith(matrix.os, 'windows') }} && steps.cache-make.outputs.cache-hit != 'true'
2331
env:
2432
VERSION: "4.4.1"
2533
shell: bash
2634
run: |
27-
wget -q "https://ftp.gnu.org/gnu/make/make-${VERSION}.tar.gz"
28-
tar zxf "make-${VERSION}.tar.gz"
35+
curl "https://ftp.gnu.org/gnu/make/make-${VERSION}.tar.gz" | tar xz
2936
pushd "make-${VERSION}"
3037
./configure
31-
make
38+
make -j 4
3239
popd
33-
cp -rp "make-${VERSION}/make" .
40+
cp -p "make-${VERSION}/make" /usr/local/bin
41+
3442
- name: Test against GNU Make from source
3543
if: ${{ !startsWith(matrix.os, 'windows') }}
3644
shell: bash
37-
run:
38-
MAKE="${PWD}/make" cargo test
45+
run: cargo test
46+
env:
47+
MAKE: /usr/local/bin/make
3948

4049
rustfmt:
4150
name: Rustfmt

0 commit comments

Comments
 (0)