From 0038b43627e6564b03d9837f535ec64ada6d70f2 Mon Sep 17 00:00:00 2001 From: Dave Tucker Date: Mon, 6 Jun 2022 19:01:06 +0100 Subject: [PATCH] Add CI Signed-off-by: Dave Tucker --- aya-log/.github/dependabot.yml | 9 ++++++ aya-log/.github/workflows/build-bpf.yml | 37 ++++++++++++++++++++++ aya-log/.github/workflows/build.yml | 26 ++++++++++++++++ aya-log/.github/workflows/lint.yml | 41 +++++++++++++++++++++++++ 4 files changed, 113 insertions(+) create mode 100644 aya-log/.github/dependabot.yml create mode 100644 aya-log/.github/workflows/build-bpf.yml create mode 100644 aya-log/.github/workflows/build.yml create mode 100644 aya-log/.github/workflows/lint.yml diff --git a/aya-log/.github/dependabot.yml b/aya-log/.github/dependabot.yml new file mode 100644 index 00000000..08c94a23 --- /dev/null +++ b/aya-log/.github/dependabot.yml @@ -0,0 +1,9 @@ +# Please see the documentation for all configuration options: +# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "cargo" + directory: "/" + schedule: + interval: "weekly" diff --git a/aya-log/.github/workflows/build-bpf.yml b/aya-log/.github/workflows/build-bpf.yml new file mode 100644 index 00000000..002e965d --- /dev/null +++ b/aya-log/.github/workflows/build-bpf.yml @@ -0,0 +1,37 @@ +name: build-bpf + +on: + push: + branches: + - main + + pull_request: + branches: + - main + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + runs-on: ubuntu-20.04 + + steps: + - uses: actions/checkout@v2 + + - uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + components: rust-src + override: true + + - uses: Swatinem/rust-cache@v1 + + - name: Pre-requisites + run: cargo install bpf-linker + + - name: Build + run: | + pushd ebpf + cargo build --verbose + popd diff --git a/aya-log/.github/workflows/build.yml b/aya-log/.github/workflows/build.yml new file mode 100644 index 00000000..dd031044 --- /dev/null +++ b/aya-log/.github/workflows/build.yml @@ -0,0 +1,26 @@ +name: build + +on: + push: + branches: + - main + + pull_request: + branches: + - main + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - uses: Swatinem/rust-cache@v1 + + - name: Build + run: cargo build --verbose + + - name: Run tests + run: RUST_BACKTRACE=full cargo test --verbose diff --git a/aya-log/.github/workflows/lint.yml b/aya-log/.github/workflows/lint.yml new file mode 100644 index 00000000..169b536e --- /dev/null +++ b/aya-log/.github/workflows/lint.yml @@ -0,0 +1,41 @@ +name: lint + +on: + push: + branches: + - main + + pull_request: + branches: + - main + +env: + CARGO_TERM_COLOR: always + +jobs: + lint: + runs-on: ubuntu-20.04 + + steps: + - uses: actions/checkout@v2 + + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly + components: rustfmt, clippy, rust-src + override: true + + - name: Check formatting + run: | + cargo fmt --all -- --check + pushd ebpf + cargo fmt --all -- --check + popd + + - name: Run clippy + run: | + cargo clippy -- --deny warnings + pushd ebpf + cargo clippy -- --deny warnings + popd