Skip to content

Commit

Permalink
configure the general CI workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
arthur3486 committed May 1, 2023
1 parent 0b853c0 commit bae6521
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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
31 changes: 31 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -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 }}
```
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bae6521

Please sign in to comment.