Skip to content

Commit

Permalink
More metadata, CI
Browse files Browse the repository at this point in the history
  • Loading branch information
kiranshila committed Aug 22, 2023
1 parent 907c46c commit 5c56d6d
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 1 deletion.
73 changes: 73 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
on: push
name: CI
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
env:
RUSTFLAGS: -D warnings
CARGO_TERM_COLOR: always
steps:
- uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0
- uses: actions-rs/toolchain@v1
with:
# We need nightly for fmt
toolchain: nightly
override: true
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v1
- name: Lint (clippy)
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-targets
- name: Lint (rustfmt)
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all --check

build:
name: Build and test
runs-on: ubuntu-latest
strategy:
matrix:
rust-version: [stable, 1.65, nightly]
fail-fast: false
env:
RUSTFLAGS: -D warnings
CARGO_TERM_COLOR: always
steps:
- uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust-version }}
override: true
components: llvm-tools-preview
- uses: Swatinem/rust-cache@v1
- name: Build all targets with
uses: actions-rs/cargo@v1
with:
command: build
args: --all-targets
- name: Tests
uses: actions-rs/cargo@v1
with:
command: test
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Generate code coverage
if: startsWith(matrix.rust-version, 'stable')
run: cargo llvm-cov --workspace --lcov --output-path lcov.info
- name: Upload coverage to Codecov
if: startsWith(matrix.rust-version, 'stable')
uses: codecov/codecov-action@v3
with:
files: lcov.info
fail_ci_if_error: true
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ license = "Apache-2.0 OR MIT"
repository = "https://github.com/kiranshila/tftp_client"
description = "A pure-rust TFTP client library"
homepage = "https://github.com/kiranshila/tftp_client"
readme = "../README.md"
readme = "README.md"
keywords = ["tftp"]
categories = ["network-programming"]

Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# tftp-client
> A pure-rust TFTP client library
[![license](https://img.shields.io/badge/license-Apache--2.0_OR_MIT-blue?style=flat-square)](#license)
[![docs](https://img.shields.io/docsrs/tftp_client?logo=rust&style=flat-square)](https://docs.rs/tftp_client/latest/tftp_client/index.html)
[![rustc](https://img.shields.io/badge/rustc-1.65+-blue?style=flat-square&logo=rust)](https://www.rust-lang.org)
[![build status](https://img.shields.io/github/actions/workflow/status/kiranshila/tftp_client/ci.yml?branch=main&style=flat-square&logo=github)](https://github.com/kiranshila/tftp_client/actions)
[![Codecov](https://img.shields.io/codecov/c/github/kiranshila/tftp_client?style=flat-square)](https://app.codecov.io/gh/kiranshila/tftp_client)

There are several TFTP crates in the rust ecosystem:
- [tftp](https://crates.io/crates/tftp)
- [async-tftp](https://crates.io/crates/async-tftp)
Expand Down
5 changes: 5 additions & 0 deletions rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
comment_width = 100
format_code_in_doc_comments = true
imports_granularity = "Crate"
imports_layout = "Vertical"
wrap_comments = true

0 comments on commit 5c56d6d

Please sign in to comment.