Skip to content

Commit

Permalink
Use CCache
Browse files Browse the repository at this point in the history
  • Loading branch information
devraymondsh committed Apr 5, 2024
1 parent 381cd01 commit d005ada
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
24 changes: 23 additions & 1 deletion .github/workflows/scheduled-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,42 @@ jobs:
container:
image: ubuntu:devel
steps:
- name: Restore CCache
uses: actions/cache@v4
with:
path: .ccache
key: ${{ runner.os }}:libnode:ccache:${{ github.run_number }}
restore-keys: |
${{ runner.os }}:libnode:ccache:
- name: Update system
run: apt-get update && apt-get --yes upgrade

- name: Install Nodejs 21 repo
run: apt-get install --yes ca-certificates curl gnupg && curl -sL https://deb.nodesource.com/setup_21.x | bash - && apt-get update

- name: Install building tools
run: apt-get install --yes git python3 python3-pip gcc g++ make ninja-build nodejs
run: apt-get install --yes git python3 python3-pip gcc g++ make ninja-build nodejs ccache

- name: Setup CCache
run: |
sudo update-ccache-symlinks
echo "/usr/lib/ccache" >> "$GITHUB_PATH"
ccacheDir="${GITHUB_WORKSPACE}/.ccache"
test -d "$ccacheDir" || mkdir "$ccacheDir"
echo "CCACHE_DIR=$ccacheDir" >> "$GITHUB_ENV"
- name: Clone the repo
run: git clone https://github.com/devraymondsh/libnode-distributable

- name: Run the script
run: cd libnode-distributable && node index.js

- name: Show CCache Status
shell: bash
run: ccache -s

- name: A buncha ls
run: ls . ; ls .. ; ls out/Debug ; ls ../out/Debug
6 changes: 5 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ if (!syncFs.existsSync("node")) {
);
}

await spawnAsync("./configure", ["--ninja", "--shared", "--debug"], "node");
await spawnAsync(
"./configure",
["--ninja", "--shared", "--debug", "CC='ccache gcc'", "CXX='ccache g++'"],
"node"
);

await spawnAsync("make", [`-j${threadCount}`], "node");

0 comments on commit d005ada

Please sign in to comment.