File tree Expand file tree Collapse file tree 4 files changed +84
-5
lines changed
Expand file tree Collapse file tree 4 files changed +84
-5
lines changed Original file line number Diff line number Diff line change @@ -3,12 +3,17 @@ set -euo pipefail
33# set -x
44
55init_vcpkg () {
6- if [[ ! -e $VCPKG ]]; then
6+ if [[ ! -d $VCPKG || -z " $( ls -A $VCPKG 2> /dev/null) " ]]; then
7+ echo " Directory $VCPKG does not exist or is empty. Cloning vcpkg..."
78 git clone https://github.com/microsoft/vcpkg.git $VCPKG
89 fi
10+
911 if [[ ! -e $VCPKG /vcpkg ]]; then
12+ echo " vcpkg executable not found. Bootstrapping vcpkg..."
1013 $VCPKG /bootstrap-vcpkg.sh -disableMetrics
1114 fi
15+
16+ echo " vcpkg is initialized at $VCPKG ."
1217}
1318
1419if [[ " ${BASH_SOURCE[0]} " == " ${0} " ]]; then
Original file line number Diff line number Diff line change 1+ name : Run Tests
2+
3+ on :
4+ push :
5+ branches :
6+ - master
7+ pull_request :
8+ workflow_dispatch :
9+ inputs :
10+ use_cache :
11+ description : ' Use cache for build'
12+ required : true
13+ default : ' true'
14+ type : ' choice'
15+ options :
16+ - ' true'
17+ - ' false'
18+
19+ env :
20+ USE_CACHE : ${{ github.event.inputs.use_cache || 'true' }}
21+ CACHE_VERSION : v01
22+ CACHE_PATHS : |
23+ ~/.cargo
24+ ~/.hunter
25+ ~/.cache/pip
26+ ~/.cache/vcpkg
27+ .vcpkg
28+ .venv
29+ .build
30+
31+ jobs :
32+ build-and-test :
33+ runs-on : ${{ matrix.os }}
34+ strategy :
35+ matrix :
36+ os : [ubuntu-24.04, macos-15]
37+ steps :
38+ - name : Checkout code
39+ uses : actions/checkout@v4
40+
41+ - name : " Restore cache dependencies"
42+ id : cache-restore
43+ if : ${{ env.USE_CACHE == 'true' }}
44+ uses : actions/cache/restore@v4
45+ with :
46+ path : ${{ env.CACHE_PATHS }}
47+ key : jam-${{ runner.os }}-${{ github.job }}-${{ env.CACHE_VERSION }}
48+ restore-keys : |
49+ jam-${{ runner.os }}-${{ github.job }}
50+ jam-${{ runner.os }}
51+
52+ - name : " Basic init"
53+ run : ./.ci/scripts/init.sh
54+
55+ - name : " Init all dependencies"
56+ run : make init_all
57+
58+ - name : " Configure"
59+ run : make configure
60+
61+ - name : " Build"
62+ run : make build
63+
64+ - name : " Test"
65+ run : make test
66+
67+ - name : " Always Save Cache"
68+ id : cache-save
69+ if : always() && ( steps.cache-restore.outputs.cache-hit != 'true' )
70+ uses : actions/cache/save@v4
71+ with :
72+ path : ${{ env.CACHE_PATH }}
73+ key : ${{ steps.cache-restore.outputs.cache-primary-key }}
Original file line number Diff line number Diff line change 3838/.build
3939/.venv
4040/.vcpkg
41+ /.build *
Original file line number Diff line number Diff line change @@ -2,10 +2,10 @@ SHELL := /bin/bash
22PROJECT := $(shell pwd)
33CI_DIR := $(PROJECT ) /.ci
44
5- VENV = $(PROJECT ) /.venv
6- BUILD = $(PROJECT ) /.build
7- VCPKG = $(PROJECT ) /.vcpkg
8- PATH = $(VENV ) /bin:$(shell echo $$PATH)
5+ VENV ?= $(PROJECT ) /.venv
6+ BUILD ?= $(PROJECT ) /.build
7+ VCPKG ?= $(PROJECT ) /.vcpkg
8+ PATH = $(VENV ) /bin:$(shell echo $$PATH)
99
1010ifneq (,$(wildcard $(CI_DIR ) /.env) )
1111 include $(CI_DIR ) /.env
You can’t perform that action at this time.
0 commit comments