From 06ba6554610763f8632c41d516ad72804031b6c5 Mon Sep 17 00:00:00 2001 From: LukeMathWalker Date: Fri, 13 Aug 2021 10:59:33 +0100 Subject: [PATCH] Add CI --- .github/workflows/general.yml | 76 +++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 .github/workflows/general.yml diff --git a/.github/workflows/general.yml b/.github/workflows/general.yml new file mode 100644 index 000000000..cd0cecd22 --- /dev/null +++ b/.github/workflows/general.yml @@ -0,0 +1,76 @@ +name: Rust + +on: + push: + branches: + - main + pull_request: + types: [ opened, synchronize, reopened ] + branches: + - main + +env: + CARGO_TERM_COLOR: always + +jobs: + test: + name: Test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Cache dependencies + id: cache-dependencies + uses: actions/cache@v2 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + - uses: actions-rs/cargo@v1 + with: + command: test + - uses: actions-rs/cargo@v1 + with: + command: test --features opentelemetry_0_13 + - uses: actions-rs/cargo@v1 + with: + command: test --features opentelemetry_0_14 + - uses: actions-rs/cargo@v1 + with: + command: test --features opentelemetry_0_15 + + fmt: + name: Rustfmt + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + components: rustfmt + - uses: actions-rs/cargo@v1 + with: + command: fmt + args: --all -- --check + + clippy: + name: Clippy + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + components: clippy + override: true + - uses: actions-rs/clippy-check@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + args: -- -D warnings \ No newline at end of file