Value for transfer #209
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build, integration tests, formatting | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
env: | |
CARGO_TERM_COLOR: always | |
RUST_TEST_THREADS: "1" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cache Cargo components | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/index | |
target | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
${{ runner.os }}-cargo- | |
- name: Set up LLVM & Clang | |
run: | | |
if ! command -v clang-19; then | |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - | |
echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-19 main" | sudo tee -a /etc/apt/sources.list.d/llvm.list | |
sudo apt-get update | |
sudo apt-get install -y llvm-19 clang-19 libclang-19-dev | |
fi | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: nightly | |
override: true | |
- name: rustup component add | |
run: rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu | |
- name: Install required tools | |
run: | | |
cargo install ziggy cargo-afl honggfuzz grcov cargo-contract | |
# Consider caching the Cargo bin dir if these installations take too long. | |
- 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 | |
./afl-system-config.sh | |
- name: Run rustfmt checks | |
run: cargo fmt -- --check | |
- name: Build in release mode | |
run: cargo build --release --verbose | |
- name: Run AFL++ configuration | |
run: | |
cargo afl config --build --plugins --verbose --force | |
- 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 |