Enable sccache, increase cores to 2, fast build
This commit is contained in:
parent
73da9f29cb
commit
9fc43e4a55
1 changed files with 14 additions and 4 deletions
|
|
@ -7,7 +7,7 @@ on:
|
||||||
branches: ["main"]
|
branches: ["main"]
|
||||||
|
|
||||||
env:
|
env:
|
||||||
CARGO_BUILD_JOBS: 1
|
CARGO_BUILD_JOBS: 2
|
||||||
CARGO_INCREMENTAL: 0
|
CARGO_INCREMENTAL: 0
|
||||||
CARGO_NET_RETRY: 10
|
CARGO_NET_RETRY: 10
|
||||||
|
|
||||||
|
|
@ -30,7 +30,7 @@ jobs:
|
||||||
cd workspace
|
cd workspace
|
||||||
git submodule update --init --depth 1 botlib
|
git submodule update --init --depth 1 botlib
|
||||||
git submodule update --init --depth 1 botui
|
git submodule update --init --depth 1 botui
|
||||||
rm .cargo/config.toml
|
|
||||||
|
|
||||||
# Remove missing members from workspace to prevent Cargo errors
|
# Remove missing members from workspace to prevent Cargo errors
|
||||||
sed -i '/"botapp",/d' Cargo.toml
|
sed -i '/"botapp",/d' Cargo.toml
|
||||||
|
|
@ -39,7 +39,7 @@ jobs:
|
||||||
cd ..
|
cd ..
|
||||||
rm -rf workspace/botserver
|
rm -rf workspace/botserver
|
||||||
mv botserver workspace/botserver
|
mv botserver workspace/botserver
|
||||||
rm -f workspace/botserver/.cargo/config.toml
|
|
||||||
|
|
||||||
|
|
||||||
- name: Cache Cargo registry
|
- name: Cache Cargo registry
|
||||||
|
|
@ -63,13 +63,23 @@ jobs:
|
||||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable --profile minimal
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable --profile minimal
|
||||||
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
|
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
|
||||||
|
|
||||||
|
- name: Install sccache
|
||||||
|
run: |
|
||||||
|
wget https://github.com/mozilla/sccache/releases/download/v0.8.2/sccache-v0.8.2-x86_64-unknown-linux-musl.tar.gz
|
||||||
|
tar xzf sccache-v0.8.2-x86_64-unknown-linux-musl.tar.gz
|
||||||
|
mv sccache-v0.8.2-x86_64-unknown-linux-musl/sccache $HOME/.cargo/bin/sccache
|
||||||
|
chmod +x $HOME/.cargo/bin/sccache
|
||||||
|
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
|
||||||
|
echo "SCCACHE_DIR=/opt/gbo/sccache" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
|
||||||
- name: Setup environment
|
- name: Setup environment
|
||||||
run: sudo cp /opt/gbo/bin/system/.env . 2>/dev/null || true
|
run: sudo cp /opt/gbo/bin/system/.env . 2>/dev/null || true
|
||||||
|
|
||||||
- name: Build debug
|
- name: Build debug
|
||||||
working-directory: workspace
|
working-directory: workspace
|
||||||
run: |
|
run: |
|
||||||
cargo build -p botserver -p botui -j 1 2>&1 | tee /tmp/build.log
|
cargo build -p botserver -p botui -j 2 2>&1 | tee /tmp/build.log
|
||||||
ls -lh target/debug/botserver
|
ls -lh target/debug/botserver
|
||||||
ls -lh target/debug/botui
|
ls -lh target/debug/botui
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue