Add GitHub CI config.
This commit is contained in:
64
.github/workflows/rust.yml
vendored
Normal file
64
.github/workflows/rust.yml
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
# Derived from regalloc.rs' GitHub CI config file.
|
||||
|
||||
name: Rust
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
# Lint code with rustfmt, report an error if it needs to be run.
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install rustfmt
|
||||
run: rustup component add rustfmt
|
||||
- name: Run rustfmt and check there's no difference
|
||||
run: cargo fmt --all -- --check
|
||||
|
||||
# Make sure the code compiles and that all the tests pass.
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Build
|
||||
run: cargo build
|
||||
- name: Run tests
|
||||
run: cargo test --all --verbose
|
||||
|
||||
# Lint dependency graph for security advisories, duplicate versions, and
|
||||
# incompatible licences.
|
||||
cargo_deny:
|
||||
name: Cargo deny
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: true
|
||||
- run: |
|
||||
set -e
|
||||
curl -L https://github.com/EmbarkStudios/cargo-deny/releases/download/0.8.5/cargo-deny-0.8.5-x86_64-unknown-linux-musl.tar.gz | tar xzf -
|
||||
mv cargo-deny-*-x86_64-unknown-linux-musl/cargo-deny cargo-deny
|
||||
echo `pwd` >> $GITHUB_PATH
|
||||
- run: cargo deny check
|
||||
|
||||
# Builds the fuzz targets.
|
||||
fuzz:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install nightly
|
||||
run: rustup toolchain install nightly
|
||||
- name: Install cargo-fuzz
|
||||
run: cargo +nightly install cargo-fuzz
|
||||
- name: Build ssagen fuzzing target
|
||||
run: cargo +nightly fuzz build ssagen
|
||||
- name: Build moves fuzzing target
|
||||
run: cargo +nightly fuzz build moves
|
||||
- name: Build ion fuzzing target
|
||||
run: cargo +nightly fuzz build ion
|
||||
- name: Build and smoke-test ion_checker fuzzing target
|
||||
run: cargo +nightly fuzz run ion_checker ./fuzz/smoketest/ion_checker.bin
|
||||
BIN
fuzz/smoketest/ion_checker.bin
Normal file
BIN
fuzz/smoketest/ion_checker.bin
Normal file
Binary file not shown.
Reference in New Issue
Block a user