Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
m00sey committed Jan 17, 2023
1 parent c6e71df commit 6709405
Show file tree
Hide file tree
Showing 5 changed files with 103 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: publish

on:
push:
tags:
- "v*"
env:
CARGO_TERM_COLOR: always

jobs:
build:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true

- name: Run clippy
run: cargo clippy --all-features -- -D warnings

- name: Run tests
run: cargo test --all-features --verbose

- uses: katyo/publish-crates@v1
with:
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
47 changes: 47 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Run tests

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

env:
CARGO_TERM_COLOR: always

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true

- name: Check
run: cargo check

- name: Clippy
run: RUSTFLAGS="-Dwarnings" cargo clippy -- -D warnings

- name: Build
run: cargo build

- name: Test
run: cargo test

- name: Format
run: cargo fmt --all -- --check

- name: Run cargo-tarpaulin
uses: actions-rs/[email protected]
with:
version: '0.22.0'

- name: Upload to codecov.io
uses: codecov/codecov-action@v3
with:
token: ${{secrets.CODECOV_TOKEN}}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/target
/Cargo.lock
.idea
10 changes: 10 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[package]
name = "parside"
version = "0.1.1"
edition = "2021"
description = "Parser for Composable Event Streaming Representation (CESR)"
license = "Apache-2.0"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
14 changes: 14 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
pub fn add(left: usize, right: usize) -> usize {
left + right
}

#[cfg(test)]
mod tests {
use super::*;

#[test]
fn it_works() {
let result = add(2, 2);
assert_eq!(result, 4);
}
}

0 comments on commit 6709405

Please sign in to comment.