Skip to content

Commit 584b0da

Browse files
authored
Merge pull request #1729 from RustPython/coolreader18/cache-actions
Cache Cargo dependencies in Github Actions
2 parents 17fdc19 + 5d2ddc7 commit 584b0da

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

.github/workflows/ci.yaml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,14 @@ jobs:
1717
- uses: actions/checkout@master
1818
- name: Convert symlinks to hardlink (windows only)
1919
run: powershell.exe scripts/symlinks-to-hardlinks.ps1
20-
if: matrix.os == 'windows-latest'
20+
if: runner.os == 'Windows'
21+
- name: Cache cargo dependencies
22+
uses: actions/cache@v1
23+
with:
24+
key: ${{ runner.os }}-rust_tests-${{ hashFiles('Cargo.lock') }}
25+
path: target
26+
restore-keys: |
27+
${{ runner.os }}-rust_tests-
2128
- name: run rust tests
2229
uses: actions-rs/cargo@v1
2330
with:
@@ -35,7 +42,14 @@ jobs:
3542
- uses: actions/checkout@master
3643
- name: Convert symlinks to hardlink (windows only)
3744
run: powershell.exe scripts/symlinks-to-hardlinks.ps1
38-
if: matrix.os == 'windows-latest'
45+
if: runner.os == 'Windows'
46+
- name: Cache cargo dependencies
47+
uses: actions/cache@v1
48+
with:
49+
key: ${{ runner.os }}-snippets-${{ hashFiles('Cargo.lock') }}
50+
path: target
51+
restore-keys: |
52+
${{ runner.os }}-snippets-
3953
- name: build rustpython
4054
uses: actions-rs/cargo@v1
4155
with:

0 commit comments

Comments
 (0)