Skip to content

Commit d15e6d2

Browse files
committed
wx, chore: init project for concurrency
0 parents  commit d15e6d2

File tree

13 files changed

+572
-0
lines changed

13 files changed

+572
-0
lines changed

.github/workflows/build.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: build
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
tags:
8+
- v*
9+
pull_request:
10+
branches:
11+
- master
12+
13+
permissions:
14+
contents: write
15+
16+
jobs:
17+
build-rust:
18+
strategy:
19+
matrix:
20+
platform: [ubuntu-latest]
21+
runs-on: ${{ matrix.platform }}
22+
steps:
23+
- uses: actions/checkout@v4
24+
with:
25+
fetch-depth: 0
26+
submodules: recursive
27+
- name: Install Rust
28+
run: rustup toolchain install stable --component llvm-tools-preview
29+
- name: Install cargo-llvm-cov
30+
uses: taiki-e/install-action@cargo-llvm-cov
31+
- name: install nextest
32+
uses: taiki-e/install-action@nextest
33+
- uses: Swatinem/rust-cache@v2
34+
- name: Check code format
35+
run: cargo fmt -- --check
36+
- name: Check the package for errors
37+
run: cargo check --all
38+
- name: Lint rust sources
39+
run: cargo clippy --all-targets --all-features --tests --benches -- -D warnings
40+
- name: Execute rust tests
41+
run: cargo nextest run --all-features
42+
- name: Generate a changelog
43+
uses: orhun/git-cliff-action@v2
44+
id: git-cliff
45+
if: startsWith(github.ref, 'refs/tags/')
46+
with:
47+
config: cliff.toml
48+
args: -vv --latest --strip header
49+
env:
50+
OUTPUT: CHANGES.md
51+
- name: Release
52+
uses: softprops/action-gh-release@v1
53+
if: startsWith(github.ref, 'refs/tags/')
54+
with:
55+
body: ${{ steps.git-cliff.outputs.content }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/target

.pre-commit-config.yaml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
fail_fast: false
2+
repos:
3+
- repo: https://github.com/pre-commit/pre-commit-hooks
4+
rev: v4.3.0
5+
hooks:
6+
- id: check-byte-order-marker
7+
- id: check-case-conflict
8+
- id: check-merge-conflict
9+
- id: check-symlinks
10+
- id: check-yaml
11+
- id: end-of-file-fixer
12+
- id: mixed-line-ending
13+
- id: trailing-whitespace
14+
- repo: https://github.com/psf/black
15+
rev: 22.10.0
16+
hooks:
17+
- id: black
18+
- repo: local
19+
hooks:
20+
- id: cargo-fmt
21+
name: cargo fmt
22+
description: Format files with rustfmt.
23+
entry: bash -c 'cargo fmt -- --check'
24+
language: rust
25+
files: \.rs$
26+
args: []
27+
- id: cargo-deny
28+
name: cargo deny check
29+
description: Check cargo dependencies
30+
entry: bash -c 'cargo deny check -d'
31+
language: rust
32+
files: \.rs$
33+
args: []
34+
- id: typos
35+
name: typos
36+
description: check typo
37+
entry: bash -c 'typos'
38+
language: rust
39+
files: \.*$
40+
pass_filenames: false
41+
- id: cargo-check
42+
name: cargo check
43+
description: Check the package for errors.
44+
entry: bash -c 'cargo check --all'
45+
language: rust
46+
files: \.rs$
47+
pass_filenames: false
48+
- id: cargo-clippy
49+
name: cargo clippy
50+
description: Lint rust sources
51+
entry: bash -c 'cargo clippy --all-targets --all-features --tests --benches -- -D warnings'
52+
language: rust
53+
files: \.rs$
54+
pass_filenames: false
55+
- id: cargo-test
56+
name: cargo test
57+
description: unit test for the project
58+
entry: bash -c 'cargo nextest run --all-features'
59+
language: rust
60+
files: \.rs$
61+
pass_filenames: false

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file. See [conventional commits](https://www.conventionalcommits.org/) for commit guidelines.
4+
5+
---
6+
## [unreleased]
7+
8+
### Miscellaneous Chores
9+
10+
- initialize basic structure for the repo - ([2436bec](https://github.com/tyrchen/qdrant-lib/commit/2436bec4a02caac64f6c1f97ca79b6ce745b4f53)) - Tyr Chen
11+
12+
### Other
13+
14+
- init the project and add the assets - ([6a3ca0a](https://github.com/tyrchen/qdrant-lib/commit/6a3ca0a900451c55969cc8dec20afb5351d86599)) - Tyr Chen
15+
16+
<!-- generated by git-cliff -->

Cargo.lock

Lines changed: 7 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: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[package]
2+
name = "template"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7+
8+
[dependencies]

README.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# Geektime Rust 语言训练营
2+
3+
## 环境设置
4+
5+
### 安装 Rust
6+
7+
```bash
8+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
9+
```
10+
11+
### 安装 VSCode 插件
12+
13+
- crates: Rust 包管理
14+
- Even Better TOML: TOML 文件支持
15+
- Better Comments: 优化注释显示
16+
- Error Lens: 错误提示优化
17+
- GitLens: Git 增强
18+
- Github Copilot: 代码提示
19+
- indent-rainbow: 缩进显示优化
20+
- Prettier - Code formatter: 代码格式化
21+
- REST client: REST API 调试
22+
- rust-analyzer: Rust 语言支持
23+
- Rust Test lens: Rust 测试支持
24+
- Rust Test Explorer: Rust 测试概览
25+
- TODO Highlight: TODO 高亮
26+
- vscode-icons: 图标优化
27+
- YAML: YAML 文件支持
28+
29+
### 安装 cargo generate
30+
31+
cargo generate 是一个用于生成项目模板的工具。它可以使用已有的 github repo 作为模版生成新的项目。
32+
33+
```bash
34+
cargo install cargo-generate
35+
```
36+
37+
在我们的课程中,新的项目会使用 `tyr-rust-bootcamp/template` 模版生成基本的代码:
38+
39+
```bash
40+
cargo generate tyr-rust-bootcamp/template
41+
```
42+
43+
### 安装 pre-commit
44+
45+
pre-commit 是一个代码检查工具,可以在提交代码前进行代码检查。
46+
47+
```bash
48+
pipx install pre-commit
49+
```
50+
51+
安装成功后运行 `pre-commit install` 即可。
52+
53+
### 安装 Cargo deny
54+
55+
Cargo deny 是一个 Cargo 插件,可以用于检查依赖的安全性。
56+
57+
```bash
58+
cargo install --locked cargo-deny
59+
```
60+
61+
### 安装 typos
62+
63+
typos 是一个拼写检查工具。
64+
65+
```bash
66+
cargo install typos-cli
67+
```
68+
69+
### 安装 git cliff
70+
71+
git cliff 是一个生成 changelog 的工具。
72+
73+
```bash
74+
cargo install git-cliff
75+
```
76+
77+
### 安装 cargo nextest
78+
79+
cargo nextest 是一个 Rust 增强测试工具。
80+
81+
```bash
82+
cargo install cargo-nextest --locked
83+
```

_typos.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[default.extend-words]
2+
3+
[files]
4+
extend-exclude = ["CHANGELOG.md", "notebooks/*"]

assets/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Assets
2+
3+
- [juventus.csv](./juventus.csv): dataset from [The-Football-Data](https://github.com/buckthorndev/The-Football-Data).

assets/juventus.csv

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
Name,Position,DOB,Nationality,Kit Number
2+
Wojciech Szczesny,Goalkeeper,"Apr 18, 1990 (29)",Poland,1
3+
Mattia Perin,Goalkeeper,"Nov 10, 1992 (26)",Italy,37
4+
Gianluigi Buffon,Goalkeeper,"Jan 28, 1978 (41)",Italy,77
5+
Carlo Pinsoglio,Goalkeeper,"Mar 16, 1990 (29)",Italy,31
6+
Matthijs de Ligt,Centre-Back,"Aug 12, 1999 (20)",Netherlands,4
7+
Leonardo Bonucci,Centre-Back,"May 1, 1987 (32)",Italy,19
8+
Daniele Rugani,Centre-Back,"Jul 29, 1994 (25)",Italy,24
9+
Merih Demiral,Centre-Back,"Mar 5, 1998 (21)",Turkey,28
10+
Giorgio Chiellini,Centre-Back,"Aug 14, 1984 (35)",Italy,3
11+
Alex Sandro,Left-Back,"Jan 26, 1991 (28)",Brazil,12
12+
Danilo,Right-Back,"Jul 15, 1991 (28)",Brazil,13
13+
Mattia De Sciglio,Right-Back,"Oct 20, 1992 (27)",Italy,2
14+
Emre Can,Defensive Midfield,"Jan 12, 1994 (25)",Germany,23
15+
Miralem Pjanic,Central Midfield,"Apr 2, 1990 (29)",Bosnia-Herzegovina,5
16+
Aaron Ramsey,Central Midfield,"Dec 26, 1990 (28)",Wales,8
17+
Adrien Rabiot,Central Midfield,"Apr 3, 1995 (24)",France,25
18+
Rodrigo Bentancur,Central Midfield,"Jun 25, 1997 (22)",Uruguay,30
19+
Blaise Matuidi,Central Midfield,"Apr 9, 1987 (32)",France,14
20+
Sami Khedira,Central Midfield,"Apr 4, 1987 (32)",Germany,6
21+
Cristiano Ronaldo,Left Winger,"Feb 5, 1985 (34)",Portugal,7
22+
Marko Pjaca,Left Winger,"May 6, 1995 (24)",Croatia,15
23+
Federico Bernardeschi,Right Winger,"Feb 16, 1994 (25)",Italy,33
24+
Douglas Costa,Right Winger,"Sep 14, 1990 (29)",Brazil,11
25+
Juan Cuadrado,Right Winger,"May 26, 1988 (31)",Colombia,16
26+
Paulo Dybala,Second Striker,"Nov 15, 1993 (25)",Argentina,10
27+
Gonzalo Higuaín,Centre-Forward,"Dec 10, 1987 (31)",Argentina,21
28+
Mario Mandzukic,Centre-Forward,"May 21, 1986 (33)",Croatia,17

0 commit comments

Comments
 (0)