diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml new file mode 100644 index 0000000..6143cca --- /dev/null +++ b/.github/workflows/audit.yml @@ -0,0 +1,19 @@ +name: Audit + +on: + push: + paths: + - '**/Cargo.toml' + - '**/Cargo.lock' + schedule: + - cron: '0 0 * * 0' # Once per week + +jobs: + + security_audit: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/audit-check@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/cont_integration.yml b/.github/workflows/cont_integration.yml new file mode 100644 index 0000000..40c5e97 --- /dev/null +++ b/.github/workflows/cont_integration.yml @@ -0,0 +1,61 @@ +on: [push, pull_request] + +name: CI + +jobs: + + build-test: + name: Build and test + runs-on: ubuntu-latest + strategy: + matrix: + rust: + - version: 1.60.0 # STABLE + clippy: true + - version: 1.56.1 # MSRV + steps: + - name: checkout + uses: actions/checkout@v2 + - name: Generate cache key + run: echo "${{ matrix.rust.version }} ${{ matrix.features }}" | tee .cache_key + - name: cache + uses: actions/cache@v2 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-cargo-${{ hashFiles('.cache_key') }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }} + - name: Set default toolchain + run: rustup default ${{ matrix.rust.version }} + - name: Set profile + run: rustup set profile minimal + - name: Add clippy + if: ${{ matrix.rust.clippy }} + run: rustup component add clippy + - name: Update toolchain + run: rustup update + - name: Build + run: cargo build + - name: Clippy + if: ${{ matrix.rust.clippy }} + run: cargo clippy --all-targets -- -D warnings + - name: Test + run: cargo test + + fmt: + name: Rust fmt + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Set default toolchain + run: rustup default nightly + - name: Set profile + run: rustup set profile minimal + - name: Add rustfmt + run: rustup component add rustfmt + - name: Update toolchain + run: rustup update + - name: Check fmt + run: cargo fmt --all -- --config format_code_in_doc_comments=true --check