Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set up CCache #67

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 51 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,23 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get update -qy
sudo apt-get install -qy libsdl2-dev # The compilers are already installed on GitHub's runners.
sudo apt-get install -qy libsdl2-dev ccache # The compilers are already installed on GitHub's runners.

- name: Setup CCache
run: |
eval $(printf 'PATH=/usr/lib/ccache:%s\n' "$PATH" | tee -a "$GITHUB_ENV")
cat <<EOF >>"$GITHUB_ENV"
CCACHE_MAXSIZE=500M
CCACHE_DIR=$HOME/.cache/ccache
CCACHE_BASEDIR=$PWD
EOF
- name: Cache compilation
uses: actions/cache@v4
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-${{ matrix.compiler }}-${{ matrix.os }}
restore-keys: |
ccache-${{ matrix.compiler }}

# stderr is not detected as a TTY, so diagnostics are by default printed without colours;
# forcing colours makes the log a little nicer to read.
Expand Down Expand Up @@ -118,7 +134,23 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get update -qy
sudo apt-get install -qy libsdl2-dev libfuse2 # The compilers are already installed on GitHub's runners.
sudo apt-get install -qy libsdl2-dev libfuse2 ccache # The compilers are already installed on GitHub's runners.

- name: Setup CCache
run: |
eval $(printf 'PATH=/usr/lib/ccache:%s\n' "$PATH" | tee -a "$GITHUB_ENV")
cat <<EOF >>"$GITHUB_ENV"
CCACHE_MAXSIZE=500M
CCACHE_DIR=$HOME/.cache/ccache
CCACHE_BASEDIR=$PWD
EOF
- name: Cache compilation
uses: actions/cache@v4
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-clang-ubuntu-20.04
restore-keys: |
ccache-clang

- name: Build Mesen (AppImage)
run: |
Expand Down Expand Up @@ -154,7 +186,23 @@ jobs:

- name: Install dependencies
run: |
brew install sdl2
brew install sdl2 ccache

- name: Setup CCache
run: |
eval $(printf 'PATH=$(brew --prefix)/opt/ccache/libexec:%s\n' "$PATH" | tee -a "$GITHUB_ENV")
cat <<EOF >>"$GITHUB_ENV"
CCACHE_MAXSIZE=500M
CCACHE_DIR=$HOME/.cache/ccache
CCACHE_BASEDIR=$PWD
EOF
- name: Cache compilation
uses: actions/cache@v4
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-${{ matrix.compiler }}-${{ matrix.platform.os }}
restore-keys: |
ccache-${{ matrix.compiler }}

# stderr is not detected as a TTY, so diagnostics are by default printed without colours;
# forcing colours makes the log a little nicer to read.
Expand Down