Skip to content

Commit

Permalink
chore: initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
leroyguillaume committed Jan 21, 2024
0 parents commit adb6b43
Show file tree
Hide file tree
Showing 15 changed files with 2,391 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
changelog:
categories:
- title: 💣 Breaking Changes
labels:
- breaking-change
- title: 🚀 Features
labels:
- feature
- title: 🐛 Bug Fixes
labels:
- bug
- title: 📝 Documentation
labels:
- doc
- title: 🧪 Tests
labels:
- test
- title: 🛠️ Build
labels:
- build
42 changes: 42 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true

on:
push:
paths:
- .github/workflows/build.yml
- '**/*.rs'
- Cargo.lock
- Cargo.toml
tags-ignore: ['*']

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@main

- name: Set up Rust
id: rust
uses: actions-rs/toolchain@master
with:
toolchain: stable

- name: Restore cache
uses: actions/cache@main
with:
path: |
~/.cargo/bin/
~/.cargo/git/db/
~/.cargo/registry/index/
~/.cargo/registry/cache/
target/
key: build-${{ runner.os }}-${{ steps.rust.outputs.rustc_hash }}-${{ hashFiles('**/Cargo.lock') }}

- name: Build
run: cargo build --all-features --examples
42 changes: 42 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Lint

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true

on:
push:
tags-ignore: ['*']

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@main

- name: Set up Python
uses: actions/setup-python@main
with:
python-version: '3'

- name: Set up Rust
id: rust
uses: actions-rs/toolchain@master
with:
toolchain: stable

- name: Restore cache
uses: actions/cache@main
with:
path: |
~/.cargo/bin/
~/.cargo/git/db/
~/.cargo/registry/index/
~/.cargo/registry/cache/
target/
key: build-${{ runner.os }}-${{ steps.rust.outputs.rustc_hash }}-${{ hashFiles('**/Cargo.lock') }}

- name: Run pre-commit
uses: pre-commit/action@main
31 changes: 31 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Release

permissions:
contents: write

on:
push:
tags: ['*']

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@main

- name: Set up Rust
uses: actions-rs/toolchain@master
with:
toolchain: stable

- name: Publish
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: cargo publish --all-features

- name: Create release
uses: softprops/action-gh-release@master
with:
generate_release_notes: true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target
27 changes: 27 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-json
- id: check-yaml
- id: pretty-format-json
args: [--autofix]
- id: trailing-whitespace
exclude: .rs$
- id: end-of-file-fixer
exclude: .rs$
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.11.0
hooks:
- id: pretty-format-yaml
args: [--autofix]
- id: pretty-format-toml
args: [--autofix]
- repo: https://github.com/doublify/pre-commit-rust
rev: v1.0
hooks:
- id: fmt
- id: cargo-check
args: [--all-features]
- id: clippy
args: [--all-features, --tests, --, -D, warnings]
20 changes: 20 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Contributing

## Requirement

- [Rust](https://rustup.rs/)
- [pre-commit](https://pre-commit.com/)

## Getting started

```bash
git clone https://github.com/leroyguillaume/stream-consumer-task.git
cd stream-consumer-task
pre-commit install
```

## How to build

```bash
cargo build --all-features
```
Loading

0 comments on commit adb6b43

Please sign in to comment.