diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..0540cd6 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,46 @@ +name: CI + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +env: + RUST_BACKTRACE: 1 + CARGO_TERM_COLOR: always + CLICOLOR: 1 + +jobs: + build-debug: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Configure Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: stable + - name: Build Debug + run: cargo build + + build-release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Configure Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: stable + - name: Build Debug + run: cargo build --release + + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Configure Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: stable + - name: Test + run: cargo test \ No newline at end of file diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..630e625 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,31 @@ +name: Lint + +on: pull_request + +env: + RUST_BACKTRACE: 1 + CARGO_TERM_COLOR: always + CLICOLOR: 1 + +jobs: + clippy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Configure Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: stable + components: clippy + - name: Run Linter + run: cargo clippy -- -D warnings + - name: Comment On Pull Request + uses: thollander/actions-comment-pull-request@v2 + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + with: + message: | + ⚠️ Linter warnings found: + ``` + ${{ steps.run-clippy.outputs.stdout }} + ``` \ No newline at end of file diff --git a/README.md b/README.md index f1207cb..f2b9a6c 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ A simple self-contained CLI tool that makes it easy to efficiently encrypt/decrypt your files. +[![Build](https://github.com/arthur3486/cryptic/workflows/CI/badge.svg?branch=main)](https://github.com/arthur3486/cryptic/actions) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) ## Contents