Skip to content

Commit ad182be

Browse files
author
Deploy from CI
committed
Deploy 6bb1fe7 to gh-pages
0 parents  commit ad182be

File tree

60 files changed

+10725
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+10725
-0
lines changed

.gitattributes

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
###############################################################################
2+
# Set default behavior to automatically normalize line endings.
3+
###############################################################################
4+
* text=auto
5+
6+
###############################################################################
7+
# Set default behavior for command prompt diff.
8+
#
9+
# This is need for earlier builds of msysgit that does not have it on by
10+
# default for csharp files.
11+
# Note: This is only used by command line
12+
###############################################################################
13+
#*.cs diff=csharp
14+
15+
###############################################################################
16+
# Set the merge driver for project and solution files
17+
#
18+
# Merging from the command prompt will add diff markers to the files if there
19+
# are conflicts (Merging from VS is not affected by the settings below, in VS
20+
# the diff markers are never inserted). Diff markers may cause the following
21+
# file extensions to fail to load in VS. An alternative would be to treat
22+
# these files as binary and thus will always conflict and require user
23+
# intervention with every merge. To do so, just uncomment the entries below
24+
###############################################################################
25+
#*.sln merge=binary
26+
#*.csproj merge=binary
27+
#*.vbproj merge=binary
28+
#*.vcxproj merge=binary
29+
#*.vcproj merge=binary
30+
#*.dbproj merge=binary
31+
#*.fsproj merge=binary
32+
#*.lsproj merge=binary
33+
#*.wixproj merge=binary
34+
#*.modelproj merge=binary
35+
#*.sqlproj merge=binary
36+
#*.wwaproj merge=binary
37+
38+
###############################################################################
39+
# behavior for image files
40+
#
41+
# image files are treated as binary by default.
42+
###############################################################################
43+
#*.jpg binary
44+
#*.png binary
45+
#*.gif binary
46+
47+
###############################################################################
48+
# diff behavior for common document formats
49+
#
50+
# Convert binary document formats to text before diffing them. This feature
51+
# is only available from the command line. Turn it on by uncommenting the
52+
# entries below.
53+
###############################################################################
54+
#*.doc diff=astextplain
55+
#*.DOC diff=astextplain
56+
#*.docx diff=astextplain
57+
#*.DOCX diff=astextplain
58+
#*.dot diff=astextplain
59+
#*.DOT diff=astextplain
60+
#*.pdf diff=astextplain
61+
#*.PDF diff=astextplain
62+
#*.rtf diff=astextplain
63+
#*.RTF diff=astextplain

.github/workflows/ci.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches-ignore:
6+
- 'dependabot/**'
7+
pull_request:
8+
workflow_dispatch:
9+
schedule:
10+
- cron: '0 8 * * 1'
11+
12+
jobs:
13+
ci:
14+
name: CI
15+
runs-on: ubuntu-latest
16+
17+
permissions:
18+
actions: read
19+
contents: read
20+
checks: write
21+
pull-requests: write
22+
security-events: write
23+
24+
steps:
25+
- name: Checkout Repository
26+
uses: actions/checkout@v4
27+
with:
28+
clean: true
29+
30+
- name: Install Rust
31+
run: |
32+
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain nightly
33+
source "$HOME/.cargo/env"
34+
35+
# REF: https://crates.io/crates/cargo2junit
36+
37+
- name: Install Cargo-to-JUnit
38+
run: cargo install cargo2junit
39+
40+
- name: Cargo Build
41+
run: |
42+
cargo build --features alias,fmt,lazy
43+
cargo build --features async
44+
45+
- name: Cargo Test
46+
run: |
47+
cargo test --features alias,fmt,lazy -- -Z unstable-options --format json --report-time | cargo2junit > target/debug/results.xml
48+
cargo test --features async -- -Z unstable-options --format json --report-time | cargo2junit > target/debug/results-async.xml
49+
50+
# REF: https://github.com/marketplace/actions/publish-test-results
51+
52+
- name: Publish Test Results
53+
uses: EnricoMi/publish-unit-test-result-action@v2
54+
if: (!cancelled())
55+
with:
56+
files: |
57+
target/debug/*.xml

.github/workflows/deploy.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Deploy
2+
3+
# REF: https://github.com/rust-lang/mdBook/wiki/Automated-Deployment%3A-GitHub-Actions
4+
5+
on:
6+
push:
7+
branches:
8+
- main
9+
workflow_dispatch:
10+
11+
jobs:
12+
deploy:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: write
16+
pull-requests: write
17+
steps:
18+
- uses: actions/checkout@v3
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Install Latest mdBook
23+
run: |
24+
tag=$(curl 'https://api.github.com/repos/rust-lang/mdbook/releases/latest' | jq -r '.tag_name')
25+
url="https://github.com/rust-lang/mdbook/releases/download/${tag}/mdbook-${tag}-x86_64-unknown-linux-gnu.tar.gz"
26+
mkdir mdbook
27+
curl -sSL $url | tar -xz --directory=./mdbook
28+
echo `pwd`/mdbook >> $GITHUB_PATH
29+
30+
- name: Deploy GitHub Pages
31+
run: |
32+
cd guide
33+
mdbook build
34+
git worktree add gh-pages
35+
git config user.name "Deploy from CI"
36+
git config user.email ""
37+
cd gh-pages
38+
# Delete the ref to avoid keeping history.
39+
git update-ref -d refs/heads/gh-pages
40+
rm -rf *
41+
mv ../book/* .
42+
git add .
43+
git commit -m "Deploy $GITHUB_SHA to gh-pages"
44+
git push --force --set-upstream origin gh-pages

.gitignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Generated by Cargo
2+
# will have compiled files and executables
3+
/target/
4+
5+
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
6+
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
7+
Cargo.lock
8+
9+
# These are backup files generated by rustfmt
10+
**/*.rs.bk
11+
12+
# These files are copied from the root with build scripts
13+
/src/**/README.md
14+
15+
# Generated book output
16+
guide/book

.vscode/extensions.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
3+
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
4+
5+
// List of extensions which should be recommended for users of this workspace.
6+
"recommendations": [
7+
"rust-lang.rust-analyzer",
8+
"streetsidesoftware.code-spell-checker",
9+
"vadimcn.vscode-lldb",
10+
"tamasfe.even-better-toml"
11+
],
12+
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
13+
"unwantedRecommendations": [
14+
15+
]
16+
}

.vscode/rust.code-snippets

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"Rust Test": {
3+
"prefix": "test",
4+
"scope": "rust",
5+
"body": [
6+
"#[test]",
7+
"fn ${1:name}() {",
8+
" // arrange",
9+
" $0\n",
10+
" // act",
11+
" \n",
12+
" // assert",
13+
" ",
14+
"}"
15+
],
16+
"description": "Code snippet for a test method"
17+
},
18+
19+
"Rust Test Case": {
20+
"prefix": "testcase",
21+
"scope": "rust",
22+
"body": [
23+
"#[test_case(${1:data} ; \"${2:case}\")]",
24+
"fn ${3:name}(${4:argName}: ${5:argType}) {",
25+
" // arrange",
26+
" $0\n",
27+
" // act",
28+
" \n",
29+
" // assert",
30+
" ",
31+
"}"
32+
],
33+
"description": "Code snippet for a parameterized test method"
34+
},
35+
36+
"Rust Test Module": {
37+
"prefix": "testmod",
38+
"scope": "rust",
39+
"body": [
40+
"#[cfg(test)]",
41+
"mod tests {\n",
42+
" use super::*;",
43+
" use test_case::test_case;\n",
44+
" $0",
45+
"}"
46+
],
47+
"description": "Code snippet for a nested unit test module"
48+
}
49+
}

.vscode/settings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"rust-analyzer.cargo.features": ["inject"],
3+
"debug.allowBreakpointsEverywhere": true
4+
}

.vscode/tasks.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"type": "cargo",
6+
"subcommand": "build",
7+
"problemMatcher": [
8+
"$rustc"
9+
],
10+
"group": {
11+
"kind": "build",
12+
"isDefault": true
13+
},
14+
"label": "Rust: cargo build"
15+
},
16+
{
17+
"type": "cargo",
18+
"subcommand": "test",
19+
"problemMatcher": [
20+
"$rustc"
21+
],
22+
"group": "test",
23+
"label": "Rust: cargo test"
24+
}
25+
]
26+
}

0 commit comments

Comments
 (0)