Skip to content

Commit 2bd07d8

Browse files
Enhance build workflow with ccache, concurrency, and smoke test
Co-authored-by: william1982Byrd-afk <263697744+william1982Byrd-afk@users.noreply.github.com>
1 parent 5e2a4f1 commit 2bd07d8

File tree

1 file changed

+29
-2
lines changed

1 file changed

+29
-2
lines changed

.github/workflows/build.yml

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,46 @@ name: Build
22

33
on: [push, pull_request]
44

5+
# Cancel in-progress runs for the same branch/PR to avoid wasting resources.
6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.ref }}
8+
cancel-in-progress: true
9+
510
jobs:
611
build:
712
name: build (ubuntu-latest)
813
runs-on: ubuntu-latest
914
permissions:
1015
contents: read
16+
env:
17+
CCACHE_DIR: ${{ github.workspace }}/.ccache
1118
steps:
1219
- uses: actions/checkout@v4
20+
1321
- name: Install dependencies
1422
run: |
1523
sudo apt-get -q update
1624
sudo apt-get -q -y install \
17-
make gcc libssl-dev libcurl4-openssl-dev libexpat-dev \
25+
make gcc ccache libssl-dev libcurl4-openssl-dev libexpat-dev \
1826
zlib1g-dev gettext libpcre2-dev
27+
28+
- name: Restore build cache
29+
uses: actions/cache@v4
30+
with:
31+
path: ${{ env.CCACHE_DIR }}
32+
key: ccache-build-${{ github.ref_name }}-${{ github.run_id }}
33+
restore-keys: |
34+
ccache-build-${{ github.ref_name }}-
35+
ccache-build-
36+
1937
- name: Build
20-
run: make
38+
run: |
39+
export PATH="/usr/lib/ccache:$PATH"
40+
ccache --zero-stats
41+
make
42+
ccache --show-stats
43+
44+
- name: Smoke test
45+
run: |
46+
./git --version
47+
./git init --bare /tmp/smoke-test-repo

0 commit comments

Comments
 (0)