77
88permissions :
99 contents : read
10+ packages : write
1011
1112concurrency :
1213 group : |
@@ -16,54 +17,32 @@ concurrency:
1617 }}
1718 cancel-in-progress : ${{ github.ref_type != 'tag' }}
1819
19- env :
20- SCCACHE_GHA_ENABLED : true
21- RUSTC_WRAPPER : sccache
22- RUST_VERSION : ' 1.88.0'
23- CXXBRIDGE_VERSION : ' 1.0.192'
24-
2520jobs :
21+ container :
22+ name : Build container
23+ uses : ./.github/workflows/build-container.yml
24+ with :
25+ context : ./contrib/containers/meson
26+ file : ./contrib/containers/meson/Dockerfile
27+ name : dashcore-meson-ci
28+
2629 build-librustdeps :
2730 name : Build librustdeps
31+ needs : container
2832 runs-on : ubuntu-latest
29- env :
30- CC : clang
31- CXX : clang++
33+ container :
34+ image : ${{ needs.container.outputs.path }}
35+ options : --user root
3236 steps :
3337 - name : Checkout code
3438 uses : actions/checkout@v4
3539 with :
3640 ref : ${{ github.event.pull_request.head.sha || github.sha }}
3741 submodules : recursive
3842
39- - name : Install dependencies
40- run : |
41- sudo apt-get update
42- sudo apt-get install -y ninja-build libboost-test-dev clang pipx
43- pipx install meson
44- echo "$HOME/.local/bin" >> $GITHUB_PATH
45-
46- - name : Install Rust toolchain
47- uses : dtolnay/rust-toolchain@master
48- with :
49- toolchain : ${{ env.RUST_VERSION }}
50-
5143 - name : Setup sccache
5244 uses :
mozilla-actions/[email protected] 5345
54- - name : Restore Cargo cache
55- uses : actions/cache/restore@v4
56- with :
57- path : |
58- /home/runner/.cargo/registry
59- /home/runner/.cargo/git
60- key : ${{ runner.os }}-cargo-${{ env.RUST_VERSION }}-${{ hashFiles('Cargo.lock') }}
61- restore-keys : |
62- ${{ runner.os }}-cargo-${{ env.RUST_VERSION }}-
63-
64- - name : Install cxxbridge
65- run : cargo install cxxbridge-cmd@${{ env.CXXBRIDGE_VERSION }}
66-
6746 - name : Build librustdeps
6847 run : |
6948 cd rust
@@ -76,56 +55,23 @@ jobs:
7655 meson setup builddir -Duse_rustdeps=true -Drustdeps_build_dir=${{ github.workspace }}/rust/builddir
7756 meson compile -C builddir
7857
79- - name : Save Cargo cache
80- if : github.event_name == 'push' && github.ref_name == 'develop'
81- uses : actions/cache/save@v4
82- with :
83- path : |
84- /home/runner/.cargo/registry
85- /home/runner/.cargo/git
86- key : ${{ runner.os }}-cargo-${{ env.RUST_VERSION }}-${{ hashFiles('Cargo.lock') }}
87-
8858 build-grovedb-cxx :
8959 name : Build grovedb_cxx
60+ needs : container
9061 runs-on : ubuntu-latest
91- env :
92- CC : clang
93- CXX : clang++
62+ container :
63+ image : ${{ needs.container.outputs.path }}
64+ options : --user root
9465 steps :
9566 - name : Checkout code
9667 uses : actions/checkout@v4
9768 with :
9869 ref : ${{ github.event.pull_request.head.sha || github.sha }}
9970 submodules : recursive
10071
101- - name : Install dependencies
102- run : |
103- sudo apt-get update
104- sudo apt-get install -y ninja-build libboost-test-dev clang pipx
105- pipx install meson
106- echo "$HOME/.local/bin" >> $GITHUB_PATH
107-
108- - name : Install Rust toolchain
109- uses : dtolnay/rust-toolchain@master
110- with :
111- toolchain : ${{ env.RUST_VERSION }}
112-
11372 - name : Setup sccache
11473 uses :
mozilla-actions/[email protected] 11574
116- - name : Restore Cargo cache
117- uses : actions/cache/restore@v4
118- with :
119- path : |
120- /home/runner/.cargo/registry
121- /home/runner/.cargo/git
122- key : ${{ runner.os }}-cargo-${{ env.RUST_VERSION }}-${{ hashFiles('Cargo.lock') }}
123- restore-keys : |
124- ${{ runner.os }}-cargo-${{ env.RUST_VERSION }}-
125-
126- - name : Install cxxbridge
127- run : cargo install cxxbridge-cmd@${{ env.CXXBRIDGE_VERSION }}
128-
12975 - name : Build grovedb_cxx
13076 run : |
13177 cd rust/grovedb_cxx
@@ -142,12 +88,3 @@ jobs:
14288 run : |
14389 cd src/ffi/grovedb
14490 meson test -C builddir --print-errorlogs
145-
146- - name : Save Cargo cache
147- if : github.event_name == 'push' && github.ref_name == 'develop'
148- uses : actions/cache/save@v4
149- with :
150- path : |
151- /home/runner/.cargo/registry
152- /home/runner/.cargo/git
153- key : ${{ runner.os }}-cargo-${{ env.RUST_VERSION }}-${{ hashFiles('Cargo.lock') }}
0 commit comments