Skip to content

Commit

Permalink
chore(build): add github workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
nixpig committed Jan 7, 2024
1 parent 558259d commit 25a4279
Show file tree
Hide file tree
Showing 3 changed files with 100 additions and 2 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Audit

on:
schedule:
- cron: "0 0 * * *"

push:
branches:
- main
paths:
- "**/Cargo.toml"
- "**/Cargo.lock"

pull_request:
branches:
- main
paths:
- "**/Cargo.toml"
- "**/Cargo.lock"

workflow_dispatch:
inputs:
reason:
description: "Reason for manual build and deploy"
required: true

jobs:
security_audit:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install
uses: taiki-e/install-action@cargo-deny

- name: Scan
run: cargo deny check advisories
60 changes: 60 additions & 0 deletions .github/workflows/general.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: General

on:
push:
branches:
- main
pull_request:
branches:
- main

workflow_dispatch:
inputs:
reason:
description: "Reason for manual build and deploy"
required: true

env:
CARGO_TERM_COLOR: always

jobs:
build:
environment: Production
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt

- name: Cache
uses: Swatinem/rust-cache@v2

- name: Lint
run: cargo clippy -- -D warnings

- name: Format
run: cargo fmt --check

- name: Test
run: |
cargo install cargo-tarpaulin \
&& cargo tarpaulin \
--workspace \
--no-fail-fast \
--coveralls "$COVERALLS_REPO_TOKEN"
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}

- name: Build
run: cargo build --release

- name: Archive
uses: actions/upload-artifact@v1
with:
name: corkscrew
path: target/release/corkscrew
4 changes: 2 additions & 2 deletions src/core/parser.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::types::Detail;

fn parser(src: &Vec<Detail>, target: &mut Vec<Detail>, parent_index: usize) {
for request_data in src {
fn parser(source: &Vec<Detail>, target: &mut Vec<Detail>, parent_index: usize) {
for request_data in source {
if request_data.name.is_none() && request_data.requests.is_none() {
panic!("All requests must have a name or requests.");
}
Expand Down

0 comments on commit 25a4279

Please sign in to comment.