Skip to content

Commit dda6276

Browse files
committed
add github action to build on push
1 parent e7bb6e9 commit dda6276

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

.github/workflows/build_linux.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Build - Linux
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout repository
10+
uses: actions/checkout@v4
11+
- name: Setup ccache
12+
id: setup-ccache
13+
uses: actions/cache@v4
14+
with:
15+
path: ${{ github.workspace }}/.ccache
16+
key: ${{ runner.os }}-ccache
17+
- name: Build dist
18+
env:
19+
CCACHE_DIR: ${{ github.workspace }}/.ccache
20+
run: |
21+
mkdir -p $CCACHE_DIR
22+
./src/buildallprojects
23+
./game_clean/copy.sh
24+
- name: Archive production artifacts
25+
uses: actions/upload-artifact@v4
26+
with:
27+
name: game
28+
path: |
29+
game_dist
30+
- name: Archive debug info
31+
uses: actions/upload-artifact@v4
32+
with:
33+
name: game-debug-info
34+
path: |
35+
game_dist_debug

src/buildallprojects

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ pushd "$(dirname -- "$script")" > /dev/null
88
source sdk_container
99
run_in_sniper "$@"
1010

11+
export CCACHE_SLOPPINESS="pch_defines,time_macros"
12+
export VPC_ENABLE_CCACHE="1"
13+
ccache -z
14+
1115
if [ $# -eq 0 ]; then
1216
export VPC_NINJA_BUILD_MODE="release"
1317
else
@@ -34,5 +38,6 @@ if [[ ! -e "$solution_out.ninja" ]]; then
3438
fi
3539

3640
ninja -f "$solution_out.ninja" -j$(nproc)
41+
ccache -s
3742

3843
popd

0 commit comments

Comments
 (0)