Skip to content

Commit

Permalink
(try) fix CICD yet again
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin-valerio committed Oct 24, 2024
1 parent 420af94 commit 3a86bbb
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 33 deletions.
74 changes: 42 additions & 32 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
name: Integration tests

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

env:
CARGO_TERM_COLOR: always
RUST_TEST_THREADS: "1"
Expand All @@ -15,32 +13,25 @@ env:
jobs:
build:
runs-on: ubuntu-latest
# Added a step to clean up at the end
steps:
- name: Free Disk Space
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
sudo rm -rf /opt/hostedtoolcache
df -h
- uses: actions/checkout@v4
# Fetch only the necessary history to reduce space usage
with:
fetch-depth: 1

- name: Cache Cargo components
uses: actions/cache@v3
with:
# Reduced paths to cache only the most essential components
path: |
~/.cargo/registry
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
# - name: Set up LLVM z& Clang
# run: |
# if ! command -v clang-19 &> /dev/null; then
# # Reduced apt-get update to only update the newly added source
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo -E apt-key add -
# echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-19 main" | sudo -E tee -a /etc/apt/sources.list.d/llvm.list
# sudo -E apt-get update --only-source
# sudo -E apt-get install -y --no-install-recommends llvm-19 clang-19 libclang-19-dev
# fi
path: ~/.cargo/registry
key: cargo-${{ hashFiles('Cargo.lock') }}
restore-keys: cargo-

- name: Install Rust
uses: actions-rs/toolchain@v1
Expand All @@ -58,38 +49,57 @@ jobs:
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo -E ./llvm.sh "$LLVM_VERSION"
# Cleanup after LLVM installation
rm -rf llvm.sh
sudo apt-get clean
df -h
- name: Install required tools
run: |
cargo install --force ziggy cargo-afl honggfuzz cargo-contract
cargo install --force ziggy cargo-afl honggfuzz cargo-contract
# Clean up after installation
rm -rf ~/.cargo/registry/cache
df -h
- name: Run afl-system-config
run: |
curl -s https://raw.githubusercontent.com/AFLplusplus/AFLplusplus/stable/afl-system-config > afl-system-config.sh
chmod +x afl-system-config.sh
sudo -E ./afl-system-config.sh
rm afl-system-config.sh
- name: Run AFL++ configuration
run:
run: |
cargo afl config --build --plugins --verbose --force
# Clean up after AFL configuration
cargo clean
df -h
- name: Build in release mode
run: cargo build --release --verbose
run: |
cargo build --release --verbose
# Remove debug symbols to save space
find target/release -type f -executable -exec strip {} \;
df -h
- name: Compile samples in `sample`
working-directory: ./sample
run: bash build.sh

- name: Run all unit tests
run: cargo test --no-fail-fast -- --test-threads=1
run: |
cargo test --no-fail-fast -- --test-threads=1
# Clean up after tests
cargo clean
df -h
# New step to clean up after the workflow
- name: Cleanup
# Final cleanup
- name: Final Cleanup
if: always()
run: |
sudo apt autoremove -y
sudo apt clean -y
rm -rf ~/.cargo/registry ~/.cargo/index target
rm afl-system-config.sh
cd ~
rm -rf /home/runner/work/_temp
rm -rf /home/runner/work/_actions
sudo apt clean
rm -rf ~/.cargo/registry ~/.cargo/git ~/.cargo/index
rm -rf target
cargo clean
df -h
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ contract-metadata = { version = "4.1.1" }
colored = { version = "2.1.0" }
thiserror = { version = "1.0.63" }
time = { version = "0.3.36" }
pretty_assertions = "1.4.1"

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(fuzzing)'] }

0 comments on commit 3a86bbb

Please sign in to comment.