Navigation Menu

Skip to content

Commit

Permalink
Initialize time v0.2
Browse files Browse the repository at this point in the history
Included is a GitHub Actions workflow file, which is automatically run
on all pushes and pull requests. It will ensure the crate compiles, all
tests pass, formatting is correct, documentation builds, and clippy
doesn't have any hard errors.
  • Loading branch information
jhpratt committed Oct 1, 2019
0 parents commit 86f538b
Show file tree
Hide file tree
Showing 6 changed files with 156 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
@@ -0,0 +1,12 @@
root = true

[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.yaml]
indent_size = 2
128 changes: 128 additions & 0 deletions .github/workflows/build.yaml
@@ -0,0 +1,128 @@
name: Build

on: [push, pull_request]

jobs:
check:
name: Type checking
runs-on: ${{ matrix.os }}
strategy:
matrix:
rust: [stable, 1.38.0]
os: [ubuntu-latest, windows-latest, macOS-latest]

steps:
- name: Checkout sources
uses: actions/checkout@v1
with:
fetch-depth: 1

- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true

- name: Run `cargo check`
uses: actions-rs/cargo@v1
with:
command: check
args: --all-features

test:
name: Test suite
runs-on: ${{ matrix.os }}
strategy:
matrix:
rust: [stable, 1.38.0]
os: [ubuntu-latest, windows-latest, macOS-latest]

steps:
- name: Checkout sources
uses: actions/checkout@v1
with:
fetch-depth: 1

- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true

- name: Run `cargo test`
uses: actions-rs/cargo@v1
with:
command: test
args: --all-features

fmt:
name: Formatting
runs-on: ubuntu-latest

steps:
- name: Checkout sources
uses: actions/checkout@v1
with:
fetch-depth: 1

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

- name: Install rustfmt
run: rustup component add rustfmt

- name: Run `cargo fmt`
uses: actions-rs/cargo@v1
with:
command: fmt
args: -- --check

docs:
name: Documentation
runs-on: ubuntu-latest

steps:
- name: Checkout sources
uses: actions/checkout@v1
with:
fetch-depth: 1

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

- name: Run `cargo doc`
uses: actions-rs/cargo@v1
with:
command: doc
args: --all-features

clippy:
name: Clippy
runs-on: ubuntu-latest

steps:
- name: Checkout sources
uses: actions/checkout@v1
with:
fetch-depth: 1

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

- name: Install clippy
run: rustup component add clippy

- name: Run `cargo clippy`
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features
3 changes: 3 additions & 0 deletions .gitignore
@@ -0,0 +1,3 @@
/target
**/*.rs.bk
Cargo.lock
9 changes: 9 additions & 0 deletions Cargo.toml
@@ -0,0 +1,9 @@
[package]
name = "time"
version = "0.2.0"
authors = ["Jacob Pratt <the.z.cuber@gmail.com>"]
edition = "2018"

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

[dependencies]
3 changes: 3 additions & 0 deletions rustfmt.toml
@@ -0,0 +1,3 @@
newline_style = "unix"
use_field_init_shorthand = true
use_try_shorthand = true
1 change: 1 addition & 0 deletions src/lib.rs
@@ -0,0 +1 @@

0 comments on commit 86f538b

Please sign in to comment.