@@ -20,17 +20,35 @@ jobs:
2020 - ubuntu-latest
2121 - macos-latest
2222 steps :
23+ - uses : actions/cache@v3
24+ with :
25+ path : ~/.cache/ccache
26+ # Bump the prefix number to evict all previous caches and
27+ # enforce a clean build, in the unlikely case that some
28+ # weird build error occur and ccache becomes a potential
29+ # suspect.
30+ key : 0-cache-ubuntu-latest-${{ github.run_id }}
31+ restore-keys : |
32+ 0-cache-ubuntu-latest
33+ if : matrix.os == 'ubuntu-latest'
34+ - uses : actions/cache@v3
35+ with :
36+ path : ~/Library/Caches/ccache
37+ key : 0-cache-macos-latest-${{ github.run_id }}
38+ restore-keys : |
39+ 0-cache-macos-latest
40+ if : matrix.os == 'macos-latest'
2341 - uses : actions/checkout@v1
2442 with :
2543 submodules : true
26- - name : Install ninja (macOS)
27- run : brew install ninja
44+ - name : Install ccache, ninja (macOS)
45+ run : brew install ccache ninja
2846 if : matrix.os == 'macos-latest'
29- - name : Install ninja (Linux)
30- run : sudo apt install ninja-build
47+ - name : Install ccache, ninja (Linux)
48+ run : sudo apt install ccache ninja-build
3149 if : matrix.os == 'ubuntu-latest'
3250 - name : Build
33- run : NINJA_FLAGS=-v make package
51+ run : NINJA_FLAGS=-v make package LLVM_CMAKE_FLAGS=-DLLVM_CCACHE_BUILD=ON
3452 shell : bash
3553 - name : Run the testsuite
3654 run : NINJA_FLAGS=-v make check
@@ -55,11 +73,18 @@ jobs:
5573 sys : clang32
5674 env : clang-i686
5775 steps :
76+ - uses : actions/cache@v3
77+ with :
78+ path : ~/AppData/Local/ccache
79+ key : 0-${{ format( 'cache-windows-latest-{0}', matrix.arch) }}-${{ github.run_id }}
80+ restore-keys : |
81+ 0-${{ format( 'cache-windows-latest-{0}', matrix.arch) }}
5882 - uses : msys2/setup-msys2@v2
5983 with :
6084 install : >-
6185 base-devel
6286 git
87+ mingw-w64-${{ matrix.env }}-ccache
6388 mingw-w64-${{ matrix.env }}-cmake
6489 mingw-w64-${{ matrix.env }}-ninja
6590 mingw-w64-${{ matrix.env }}-toolchain
7398 - name : Build
7499 shell : msys2 {0}
75100 run : |
76- make package
101+ make package LLVM_CMAKE_FLAGS=-DLLVM_CCACHE_BUILD=ON
77102 make check
78103 - name : Does it work sans msys2?
79104 run : |
@@ -91,6 +116,13 @@ jobs:
91116 name : Docker Build
92117 runs-on : ubuntu-latest
93118 steps :
119+ - uses : actions/cache@v3
120+ with :
121+ path : ~/.ccache
122+ key : 0-cache-ubuntu-bionic-${{ github.run_id }}
123+ restore-keys : |
124+ 0-cache-ubuntu-bionic
125+
94126 - uses : actions/checkout@v1
95127 with :
96128 submodules : true
@@ -121,7 +153,7 @@ jobs:
121153 uses : actions/upload-artifact@v1
122154 with :
123155 # Upload the dist folder. Give it a name according to the OS it was built for.
124- name : dist-ubuntu-xenial
156+ name : dist-ubuntu-bionic
125157 path : dist
126158
127159 - name : Build and push wasi-sdk docker image
0 commit comments