Browse Source

Add CI

Signed-off-by: Dave Tucker <[email protected]>
Dave Tucker 2 years ago
parent
commit
0038b43

+ 9 - 0
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"

+ 37 - 0
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

+ 26 - 0
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

+ 41 - 0
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