Skip to content

Commit

Permalink
fix(ci): free disk space to avoid abnormal fail
Browse files Browse the repository at this point in the history
Signed-off-by: lxl66566 <[email protected]>

test mount and delete

Signed-off-by: lxl66566 <[email protected]>
  • Loading branch information
lxl66566 committed Aug 8, 2024
1 parent 686cbe1 commit d35ac5f
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 42 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,8 @@ jobs:
with:
submodules: recursive

- name: Configure sccache
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Setup sccache-cache
uses: mozilla-actions/[email protected]

call_build_xline:
name: Build and Upload Artifacts
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/build_env.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
name: Build CI Env Image

on:
workflow_dispatch: {}
push:
paths:
- "ci/build-env.sh"
- "ci/Dockerfile"
workflow_dispatch:

jobs:
build_env:
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/build_xline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,9 @@ jobs:
with:
submodules: recursive

- name: Configure sccache
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Setup sccache-cache
uses: mozilla-actions/[email protected]

- name: Prepare release binaries
id: prepare_binaries
run: |
Expand Down
46 changes: 29 additions & 17 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,15 @@ jobs:
run:
shell: bash
env:
SCCACHE_GHA_ENABLED: "on"
container: ghcr.io/xline-kv/build-env:latest
SCCACHE_GHA_ENABLED: "true"
CARGO_INCREMENTAL: 0 # CI will compile all crates from beginning. So disable incremental compile may reduce compile target size.
container:
image: ghcr.io/xline-kv/build-env:latest
volumes:
- /usr/local/lib/android/:/tmp/android/
- /usr/share/dotnet:/tmp/dotnet
- /opt/ghc:/tmp/ghc
- /usr/lib/firefox:/tmp/firefox
strategy:
fail-fast: true
matrix:
Expand All @@ -34,16 +41,25 @@ jobs:
}
name: Tests ${{ matrix.config.name }}
steps:
- name: View free disk space
run: df -h /

- name: Setup sccache-cache
uses: mozilla-actions/[email protected]

- uses: actions/checkout@v4
with:
submodules: recursive

- name: Configure sccache
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Free Disk Space
run: |
rm -rf /tmp/android/* || true
rm -rf /tmp/dotnet/* || true
rm -rf /tmp/ghc/* || true
rm -rf /tmp/firefox/* || true
- name: View free disk space
run: df -h /

- name: Trailing spaces check
run: ci/scripts/check-trailing-spaces.sh
Expand All @@ -63,23 +79,23 @@ jobs:
- name: Workspace hack check
run: cargo hakari generate --diff && cargo hakari manage-deps --dry-run && cargo hakari verify

- run: sccache --zero-stats > /dev/null
- run: ${SCCACHE_PATH} --zero-stats > /dev/null

- name: Clippy ${{ matrix.config.name }}
env:
RUSTFLAGS: ${{ matrix.config.rustflags }}
run: cargo clippy ${{ matrix.config.args }} --all-targets --all-features -- -D warnings

- name: Sccache stats ${{ matrix.config.name }}
run: sccache --show-stats && sccache --zero-stats > /dev/null
run: ${SCCACHE_PATH} --show-stats && ${SCCACHE_PATH} --zero-stats > /dev/null

- name: Test ${{ matrix.config.name }}
env:
RUSTFLAGS: ${{ matrix.config.rustflags }}
run: cargo ${{ matrix.config.test }}

- name: Sccache stats ${{ matrix.config.name }}
run: sccache --show-stats
run: ${SCCACHE_PATH} --show-stats

- name: Upload coverage to Codecov
if: matrix.config.name == 'Normal'
Expand Down Expand Up @@ -122,12 +138,8 @@ jobs:
with:
submodules: recursive

- name: Configure sccache
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Setup sccache-cache
uses: mozilla-actions/[email protected]

- name: Build xline image
run: |
Expand Down
14 changes: 5 additions & 9 deletions .github/workflows/validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,21 @@ jobs:
with:
submodules: recursive

- name: Configure sccache
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Setup sccache-cache
uses: mozilla-actions/[email protected]

call_build_xline:
name: Build and Upload Artifacts
uses: ./.github/workflows/build_xline.yml
with:
docker_xline_image: 'ghcr.io/xline-kv/build-env:latest'
docker_xline_image: "ghcr.io/xline-kv/build-env:latest"
additional_setup_commands: |
sudo apt-get install -y --force-yes expect
ldd ./xline
ldd ./benchmark
cp ../fixtures/{private,public}.pem .
docker build . -t ghcr.io/xline-kv/xline:latest
docker pull gcr.io/etcd-development/etcd:v3.5.5
binaries: 'xline,benchmark'
script_name: 'validation_test.sh'
binaries: "xline,benchmark"
script_name: "validation_test.sh"
uploadLogs: true
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ madsim = { git = "https://github.com/Phoenix500526/madsim.git", branch = "update
madsim-tonic = { git = "https://github.com/Phoenix500526/madsim.git", branch = "update-tonic" }
madsim-tonic-build = { git = "https://github.com/Phoenix500526/madsim.git", branch = "update-tonic" }
madsim-tokio = { git = "https://github.com/Phoenix500526/madsim.git", branch = "update-tonic" }

5 changes: 2 additions & 3 deletions ci/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ RUN echo "=== Install rusty stuff 🦀️ ===" && \
rustup component add rustfmt llvm-tools clippy && \
rustup show -v && \
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash && \
cargo binstall -y --no-symlinks cargo-llvm-cov cargo-nextest cargo-hakari cargo-sort cargo-cache cargo-audit cargo-machete && \
cargo install --locked sccache && \
cargo cache --autoclean && \
cargo binstall -y --no-symlinks cargo-llvm-cov cargo-nextest cargo-hakari cargo-sort cargo-cache cargo-audit cargo-machete sccache && \
rm -rf "/root/.cargo/registry/index" && \
rm -rf "/root/.cargo/registry/cache" && \
rm -rf "/root/.cargo/git/db" && \
Expand Down Expand Up @@ -65,3 +63,4 @@ ENV CARGO_TERM_COLOR=always

# Enable sccache
ENV RUSTC_WRAPPER="sccache"
ENV SCCACHE_GHA_ENABLED="true"

0 comments on commit d35ac5f

Please sign in to comment.