Skip to content

Commit 42a07bc

Browse files
Beta push (#14)
* Add a GH CI workflow and update tests * Run cargo clippy * Implement clap * Add ping test * Update CLI logs-dor option * Config path, ctx * Fix tet * Fix linter Co-authored-by: gillchristian <[email protected]>
1 parent 1fa1adc commit 42a07bc

File tree

6 files changed

+322
-75
lines changed

6 files changed

+322
-75
lines changed

.github/workflows/rust.yml

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# Based on https://github.com/actions-rs/meta/blob/master/recipes/msrv.md
2+
name: Rust
3+
4+
on: [push, pull_request]
5+
6+
jobs:
7+
check:
8+
name: Check
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
rust:
13+
- stable
14+
- nightly
15+
steps:
16+
- name: Checkout sources
17+
uses: actions/checkout@v1
18+
19+
- name: Install toolchain
20+
uses: actions-rs/toolchain@v1
21+
with:
22+
toolchain: ${{ matrix.rust }}
23+
override: true
24+
25+
- name: Run cargo check
26+
uses: actions-rs/cargo@v1
27+
with:
28+
command: check
29+
30+
test:
31+
name: Test Suite
32+
runs-on: ubuntu-latest
33+
strategy:
34+
matrix:
35+
rust:
36+
- stable
37+
- nightly
38+
steps:
39+
- name: Checkout sources
40+
uses: actions/checkout@v1
41+
42+
- name: Install toolchain
43+
uses: actions-rs/toolchain@v1
44+
with:
45+
toolchain: ${{ matrix.rust }}
46+
override: true
47+
48+
- name: Run cargo test
49+
uses: actions-rs/cargo@v1
50+
with:
51+
command: test
52+
53+
fmt:
54+
name: Format
55+
runs-on: ubuntu-latest
56+
strategy:
57+
matrix:
58+
rust:
59+
- stable
60+
- nightly
61+
steps:
62+
- name: Checkout sources
63+
uses: actions/checkout@v1
64+
65+
- name: Install toolchain
66+
uses: actions-rs/toolchain@v1
67+
with:
68+
toolchain: ${{ matrix.rust }}
69+
override: true
70+
71+
- name: Install rustfmt
72+
run: rustup component add rustfmt
73+
74+
- name: Run cargo fmt
75+
uses: actions-rs/cargo@v1
76+
with:
77+
command: fmt
78+
args: --all -- --check
79+
80+
clippy:
81+
name: Clippy
82+
runs-on: ubuntu-latest
83+
strategy:
84+
matrix:
85+
rust:
86+
- stable
87+
- nightly
88+
steps:
89+
- name: Checkout sources
90+
uses: actions/checkout@v1
91+
92+
- name: Install toolchain
93+
uses: actions-rs/toolchain@v1
94+
with:
95+
toolchain: ${{ matrix.rust }}
96+
override: true
97+
98+
- name: Install clippy
99+
run: rustup component add clippy
100+
101+
- name: Run cargo clippy
102+
uses: actions-rs/cargo@v1
103+
with:
104+
command: clippy
105+
args: -- -D warnings

.threshfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
port = 8080
2-
log = "./logs"
2+
logs_dir = "./logs"
33
run_job_on_ping = false
44

55
[[projects]]

Cargo.lock

Lines changed: 52 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[package]
22
name = "thresh"
33
version = "0.1.0"
4+
description = "Tiny local continuous integration based on Github webhooks"
45
authors = ["gillchristian <[email protected]>", "ndelvalle <[email protected]>"]
56
edition = "2018"
67

@@ -17,3 +18,4 @@ serde_json = "1.0"
1718
shellexpand = "2.0"
1819
toml = "0.5"
1920
actix-files = "0.2.2"
21+
clap = "2.33.1"

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88

99
```bash
1010
cargo run
11+
12+
# Setting CLI options
13+
cargo run -- --port 9090 --logs-dir ./logs
1114
```
1215

1316
```bash

0 commit comments

Comments
 (0)