Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c0ef972

Browse files
committed
ci: Add caching to match Travis.
1 parent d17cc1c commit c0ef972

1 file changed

Lines changed: 40 additions & 1 deletion

File tree

.github/workflows/tests.yml

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ jobs:
5353
Linux)
5454
sudo apt-get update -yy
5555
sudo apt-get install -yy \
56+
ccache \
5657
cm-super \
5758
dvipng \
5859
ffmpeg \
@@ -88,10 +89,47 @@ jobs:
8889
ttf-wqy-zenhei
8990
;;
9091
macOS)
91-
true
92+
brew update
93+
brew install ccache
9294
;;
9395
esac
9496
97+
- name: Cache pip
98+
uses: actions/cache@v2
99+
if: startsWith(runner.os, 'Linux')
100+
with:
101+
path: ~/.cache/pip
102+
key: ${{ runner.os }}-py${{ matrix.python-version }}-pip-${{ hashFiles('requirements/*/*.txt') }}
103+
restore-keys: |
104+
${{ runner.os }}-py${{ matrix.python-version }}-pip-
105+
- name: Cache pip
106+
uses: actions/cache@v2
107+
if: startsWith(runner.os, 'macOS')
108+
with:
109+
path: ~/Library/Caches/pip
110+
key: ${{ runner.os }}-py${{ matrix.python-version }}-pip-${{ hashFiles('requirements/*/*.txt') }}
111+
restore-keys: |
112+
${{ runner.os }}-py${{ matrix.python-version }}-pip-
113+
- name: Cache ccache
114+
uses: actions/cache@v2
115+
with:
116+
path: |
117+
~/.ccache
118+
key: ${{ runner.os }}-py${{ matrix.python-version }}-ccache-${{ hashFiles('src/*') }}
119+
restore-keys: |
120+
${{ runner.os }}-py${{ matrix.python-version }}-ccache-
121+
- name: Cache Matplotlib
122+
uses: actions/cache@v2
123+
with:
124+
path: |
125+
~/.cache/matplotlib
126+
!~/.cache/matplotlib/tex.cache
127+
!~/.cache/matplotlib/test_cache
128+
key: ${{ runner.os }}-py${{ matrix.python-version }}-mpl-${{ github.ref }}-${{ github.sha }}
129+
restore-keys: |
130+
${{ runner.os }}-py${{ matrix.python-version }}-mpl-${{ github.ref }}-
131+
${{ runner.os }}-py${{ matrix.python-version }}-mpl-
132+
95133
- name: Install Python dependencies
96134
run: |
97135
# Upgrade pip and setuptools and wheel to get as clean an install as
@@ -147,6 +185,7 @@ jobs:
147185
148186
- name: Install Matplotlib
149187
run: |
188+
ccache -s
150189
git describe
151190
152191
# Set flag in a delayed manner to avoid issues with installing other

0 commit comments

Comments
 (0)