Skip to content

Commit 6b0786d

Browse files
committed
Initial package structure
0 parents  commit 6b0786d

14 files changed

Lines changed: 1174 additions & 0 deletions

.github/workflows/check.yml

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
# This workflow checks each crate builds and runs, and for lints.
2+
name: Check
3+
4+
# Runs this workflow
5+
on:
6+
# On all pull requests, regardless of target branch
7+
pull_request:
8+
# On PRs in the merge queue
9+
merge_group:
10+
# After merges to main
11+
push:
12+
branches:
13+
- main
14+
# When a developer asks for a manual workflow run
15+
workflow_dispatch:
16+
17+
jobs:
18+
build-rust:
19+
name: 1. Build Rust crates
20+
runs-on: ubuntu-latest
21+
# Actions are pinned to a commit to prevent supply-chain attacks
22+
steps:
23+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
24+
- uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1.17.0
25+
with:
26+
toolchain: nightly
27+
# Use the same components in every step for caching
28+
components: cargo,clippy,rustfmt
29+
- name: Build each Rust crate
30+
run: cargo build --workspace --all-targets --all-features
31+
32+
test-rust:
33+
name: 2. Test Rust crates
34+
runs-on: ubuntu-latest
35+
steps:
36+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
37+
- uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1.17.0
38+
with:
39+
toolchain: nightly
40+
components: cargo,clippy,rustfmt
41+
- name: Test each Rust crate
42+
run: cargo test --workspace --all-targets --all-features
43+
44+
run:
45+
name: 3. Run default Rust crate
46+
runs-on: ubuntu-latest
47+
steps:
48+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
49+
- uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1.17.0
50+
with:
51+
toolchain: nightly
52+
components: cargo,clippy,rustfmt
53+
- name: Run default Rust crate
54+
run: # cargo run --all-features --bin-name TODO
55+
56+
clippy-rust:
57+
name: 4. Clippy lints on Rust crates
58+
runs-on: ubuntu-latest
59+
steps:
60+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
61+
- uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1.17.0
62+
with:
63+
toolchain: nightly
64+
components: cargo,clippy,rustfmt
65+
- name: Run clippy on Rust crates
66+
run: cargo clippy --workspace --all-targets --all-features -- --deny warnings
67+
68+
doc-rust:
69+
name: 5. Doc lints on Rust crates
70+
runs-on: ubuntu-latest
71+
steps:
72+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
73+
- uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1.17.0
74+
with:
75+
toolchain: nightly
76+
components: cargo,clippy,rustfmt
77+
- name: Run doc checks on Rust crates
78+
run: cargo doc --workspace --all-features
79+
80+
fmt-rust:
81+
name: 6. Code format on Rust crates
82+
runs-on: ubuntu-latest
83+
steps:
84+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
85+
- uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1.17.0
86+
with:
87+
toolchain: nightly
88+
components: cargo,clippy,rustfmt
89+
- name: Run rustfmt checks on crates
90+
run: cargo fmt --all -- --check
91+
92+
all:
93+
name: All checks
94+
# Always run this job, even if earlier steps were skipped (or failed):
95+
# <https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/troubleshooting-required-status-checks#handling-skipped-but-required-checks>
96+
if: ${{ always() }}
97+
runs-on: ubuntu-latest
98+
needs:
99+
- build-rust
100+
- test-rust
101+
- run
102+
- clippy-rust
103+
- doc-rust
104+
- fmt-rust
105+
steps:
106+
- name: Fail if any other job failed
107+
# Every job status needs to be checked here, because `always()` stops failures from propagating automatically
108+
run: |
109+
echo "Checking other jobs..."
110+
[[ "${{ needs.build-rust.result }}" == "success" ]] || exit 1
111+
[[ "${{ needs.test-rust.result }}" == "success" ]] || exit 1
112+
[[ "${{ needs.run.result }}" == "success" ]] || exit 1
113+
[[ "${{ needs.clippy-rust.result }}" == "success" ]] || exit 1
114+
[[ "${{ needs.doc-rust.result }}" == "success" ]] || exit 1
115+
[[ "${{ needs.fmt-rust.result }}" == "success" ]] || exit 1

.gitignore

Lines changed: 233 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,233 @@
1+
## Put ignore settings for your editor in your global gitignore file.
2+
# <https://docs.github.com/en/get-started/git-basics/ignoring-files#configuring-ignored-files-for-all-repositories-on-your-computer>
3+
#
4+
# Find an example file for your editor here:
5+
# <https://github.com/github/gitignore/tree/main>
6+
# <https://github.com/github/gitignore/tree/main/Global>
7+
# <https://github.com/github/gitignore/tree/main/community>
8+
9+
## If you're adding a build system example, add its gitignore rules to this file, and link to where they're from
10+
11+
## Custom rules
12+
# See the end of the file for custom include rules
13+
14+
# Common executable name
15+
main
16+
17+
## <https://github.com/github/gitignore/blob/main/Rust.gitignore>
18+
19+
# Generated by Cargo
20+
# will have compiled files and executables
21+
debug/
22+
target/
23+
24+
# These are backup files generated by rustfmt
25+
**/*.rs.bk
26+
27+
# MSVC Windows builds of rustc generate these, which store debugging information
28+
*.pdb
29+
30+
## <https://github.com/github/gitignore/blob/main/C++.gitignore>
31+
32+
# Prerequisites
33+
*.d
34+
35+
# Compiled Object files
36+
*.slo
37+
*.lo
38+
*.o
39+
*.obj
40+
41+
# Precompiled Headers
42+
*.gch
43+
*.pch
44+
45+
# Linker files
46+
*.ilk
47+
48+
# Debugger Files
49+
*.pdb
50+
51+
# Compiled Dynamic libraries
52+
*.so
53+
*.dylib
54+
*.dll
55+
*.so.*
56+
57+
58+
# Fortran module files
59+
*.mod
60+
*.smod
61+
62+
# Compiled Static libraries
63+
*.lai
64+
*.la
65+
*.a
66+
*.lib
67+
68+
# Executables
69+
*.exe
70+
*.out
71+
*.app
72+
73+
# Build directories
74+
build/
75+
Build/
76+
build-*/
77+
78+
# CMake generated files
79+
CMakeFiles/
80+
CMakeCache.txt
81+
cmake_install.cmake
82+
Makefile
83+
install_manifest.txt
84+
compile_commands.json
85+
86+
# Temporary files
87+
*.tmp
88+
*.log
89+
*.bak
90+
*.swp
91+
92+
# vcpkg
93+
vcpkg_installed/
94+
95+
# debug information files
96+
*.dwo
97+
98+
# test output & cache
99+
Testing/
100+
.cache/
101+
102+
## <https://github.com/github/gitignore/blob/main/C.gitignore>
103+
104+
# Prerequisites
105+
*.d
106+
107+
# Object files
108+
*.o
109+
*.ko
110+
*.obj
111+
*.elf
112+
113+
# Linker output
114+
*.ilk
115+
*.map
116+
*.exp
117+
118+
# Precompiled Headers
119+
*.gch
120+
*.pch
121+
122+
# Libraries
123+
*.lib
124+
*.a
125+
*.la
126+
*.lo
127+
128+
# Shared objects (inc. Windows DLLs)
129+
*.dll
130+
*.so
131+
*.so.*
132+
*.dylib
133+
134+
# Executables
135+
*.exe
136+
*.out
137+
*.app
138+
*.i*86
139+
*.x86_64
140+
*.hex
141+
142+
# Debug files
143+
*.dSYM/
144+
*.su
145+
*.idb
146+
*.pdb
147+
148+
# Kernel Module Compile Results
149+
*.mod*
150+
*.cmd
151+
.tmp_versions/
152+
modules.order
153+
Module.symvers
154+
Mkfile.old
155+
dkms.conf
156+
157+
# debug information files
158+
*.dwo
159+
160+
## <https://github.com/github/gitignore/blob/main/CMake.gitignore>
161+
162+
CMakeLists.txt.user
163+
CMakeCache.txt
164+
CMakeFiles
165+
CMakeScripts
166+
Testing
167+
Makefile
168+
cmake_install.cmake
169+
install_manifest.txt
170+
compile_commands.json
171+
CTestTestfile.cmake
172+
_deps
173+
CMakeUserPresets.json
174+
175+
## <https://github.com/github/gitignore/blob/main/Global/Windows.gitignore>
176+
177+
# Windows thumbnail cache files
178+
Thumbs.db
179+
Thumbs.db:encryptable
180+
ehthumbs.db
181+
ehthumbs_vista.db
182+
183+
# Dump file
184+
*.stackdump
185+
186+
# Folder config file
187+
[Dd]esktop.ini
188+
189+
# Recycle Bin used on file shares
190+
$RECYCLE.BIN/
191+
192+
# Windows Installer files
193+
*.cab
194+
*.msi
195+
*.msix
196+
*.msm
197+
*.msp
198+
199+
# Windows shortcuts
200+
*.lnk
201+
202+
## <https://github.com/github/gitignore/blob/main/Global/macOS.gitignore>
203+
204+
# General
205+
.DS_Store
206+
__MACOSX/
207+
.AppleDouble
208+
.LSOverride
209+
Icon[]
210+
211+
# Thumbnails
212+
._*
213+
214+
# Files that might appear in the root of a volume
215+
.DocumentRevisions-V100
216+
.fseventsd
217+
.Spotlight-V100
218+
.TemporaryItems
219+
.Trashes
220+
.VolumeIcon.icns
221+
.com.apple.timemachine.donotpresent
222+
223+
# Directories potentially created on remote AFP share
224+
.AppleDB
225+
.AppleDesktop
226+
Network Trash Folder
227+
Temporary Items
228+
.apdisk
229+
230+
## Custom Include Rules
231+
232+
# Not a temporary build directory
233+
!examples/build-tool-template

CODE_OF_CONDUCT.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# [Code of Conduct](code-of-conduct)
2+
3+
The Rust Foundation has adopted a Code of Conduct that we expect project
4+
participants to adhere to. Please read
5+
[the full text][code-of-conduct]
6+
so that you can understand what actions will and will not be tolerated.
7+
8+
[code-of-conduct]: https://foundation.rust-lang.org/policies/code-of-conduct/

CONTRIBUTING.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Contributing to a Rust Foundation Project
2+
3+
Thank you for your interest in contributing to this Rust Foundation project.
4+
We are happy and excited to review and accept your pull requests.
5+
6+
## Before You Begin Contributing
7+
8+
### Licenses
9+
10+
There is no Contributor License Agreement to sign to contribute this project.
11+
Your contribution will be covered by the license(s) granted for this
12+
repository, commonly MIT, Apache, and/or CC-BY, but could be a different
13+
license. In other words, your contribution will be licensed to the Foundation
14+
and all downstream users under those licenses. You can read more in the
15+
Foundation's [intellectual property policy][ip-policy].
16+
17+
### Code of Conduct
18+
19+
Please review and adhere to the [code of conduct](CODE_OF_CONDUCT.md) before
20+
contributing any pull requests.
21+
22+
## Contribution Process
23+
24+
All submissions, including submissions by project members, require review. We
25+
use GitHub pull requests for this purpose. Consult [GitHub Help][pull-requests]
26+
for more information on using pull requests.
27+
28+
### Issues
29+
30+
Do you just want to file an issue for the project? Please do so in GitHub under
31+
the `Issues` tab.
32+
33+
[ip-policy]: https://foundation.rust-lang.org/policies/intellectual-property-policy/
34+
[pull-requests]: https://help.github.com/articles/about-pull-requests/

0 commit comments

Comments
 (0)