-
Notifications
You must be signed in to change notification settings - Fork 91
/
Copy pathaction.yml
47 lines (43 loc) · 1.48 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: 'setup-sccache'
description: 'Setup sccache.'
inputs:
os:
description: 'OS of the runner, used for sccache installation and start.'
required: true
runs:
using: "composite"
steps:
- name: Install sccache (macos-latest)
if: inputs.os == 'macos-latest'
shell: bash
run: |
brew update --auto-update
brew install sccache
- name: Install sccache (ubuntu)
if: ${{ startsWith(inputs.os, 'ubuntu-') }}
shell: bash
run: |
SCCACHE_DOWNLOAD_LINK=https://github.com/mozilla/sccache/releases/download
SCCACHE_VERSION=v0.2.15
SCCACHE_PREFIX="sccache-$SCCACHE_VERSION-x86_64-unknown-linux-musl"
SCCACHE_TAR="${SCCACHE_PREFIX}.tar.gz"
DOWNLOAD_LINK="${SCCACHE_DOWNLOAD_LINK}/${SCCACHE_VERSION}/${SCCACHE_TAR}"
curl -L "${DOWNLOAD_LINK}" --output ${SCCACHE_TAR}
echo "$(curl -L ${DOWNLOAD_LINK}.sha256) ${SCCACHE_TAR}" | shasum -a 256 --check --status
tar xzf ${SCCACHE_TAR}
BIN_DIR="$HOME/.local/bin"
mkdir -p ${BIN_DIR}
mv -f ${SCCACHE_PREFIX}/sccache ${BIN_DIR}/sccache
chmod a+x "${BIN_DIR}/sccache"
echo ${BIN_DIR} >> $GITHUB_PATH
- name: Install sccache (windows-latest)
if: inputs.os == 'windows-latest'
shell: pwsh
run: |
choco install sccache
- name: Start sccache
shell: bash
run: |
echo "starting sccache on ${{ inputs.os }}"
sccache --start-server
sccache -s