mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-08-02 14:50:41 -07:00
60efd643d1
## Description of change Adds `ccache` support for local compiling and Github Actions environments. This significantly speeds up incremental builds, but cold starts will take a little longer to compile. The build script now has an `-i` flag to ignore the build cache if needed. You can also manually delete the `.ccache` folder to force a fresh build too. For the GA workflow, it uses the [`ccache-action`](https://github.com/hendrikmuhs/ccache-action) action to manage and store the cached build objects. This cache should be accessible to all branches. I also removed the `--no-cache` flag when building the `spicetools/spice` image since Docker will automatically invalidate `COPY` layers if it detects the copied files have changed. ### Compile times Compiled with a 7800X3D, 32GB 6000MT/s RAM. | `main` | `ccache` (fresh) | `ccache` (cached) | `ccache` (ignore cache) | |--------|--------|--------|--------| | 2m46.047s | 3m8.886s | 0m32.638s | 2m45.148s | ## Testing Tested incremental builds by using another branch that's rebased on top of this.
32 lines
995 B
YAML
32 lines
995 B
YAML
on: [push, pull_request]
|
|
name: Continuous Integration
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
fw-ci:
|
|
name: Build
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: ./src/spice2x
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Set ccache environment variables
|
|
run: |
|
|
echo "CCACHE_DIR=${{ github.workspace }}/src/spice2x/.ccache" >> $GITHUB_ENV
|
|
- name: Install ccache
|
|
uses: hendrikmuhs/ccache-action@v1.2
|
|
- name: Calculate commit SHA
|
|
id: vars
|
|
run: |
|
|
calculatedSha=$(git rev-parse --short ${{ github.sha }})
|
|
echo "COMMIT_SHORT_SHA=$calculatedSha" >> $GITHUB_ENV
|
|
- name: Compile
|
|
run: ./build_docker.sh
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: spice2x-ci-${{ env.COMMIT_SHORT_SHA }}
|
|
path: src/spice2x/bin
|
|
if-no-files-found: error |