Skip to content

Commit 555634e

Browse files
authored
Merge pull request #1 from EmbarkStudios/impl
Initial implementation
2 parents e1d9ac8 + 3997e4b commit 555634e

File tree

212 files changed

+8893
-338
lines changed

Some content is hidden

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

212 files changed

+8893
-338
lines changed

.cargo/config.toml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
[target.'cfg(all())']
2+
rustflags = [
3+
# BEGIN - Embark standard lints v6 for Rust 1.55+
4+
# do not change or add/remove here, but one can add exceptions after this section
5+
# for more info see: <https://github.com/EmbarkStudios/rust-ecosystem/issues/59>
6+
"-Dunsafe_code",
7+
"-Wclippy::all",
8+
"-Wclippy::await_holding_lock",
9+
"-Wclippy::char_lit_as_u8",
10+
"-Wclippy::checked_conversions",
11+
"-Wclippy::dbg_macro",
12+
"-Wclippy::debug_assert_with_mut_call",
13+
"-Wclippy::doc_markdown",
14+
"-Wclippy::empty_enum",
15+
"-Wclippy::enum_glob_use",
16+
"-Wclippy::exit",
17+
"-Wclippy::expl_impl_clone_on_copy",
18+
"-Wclippy::explicit_deref_methods",
19+
"-Wclippy::explicit_into_iter_loop",
20+
"-Wclippy::fallible_impl_from",
21+
"-Wclippy::filter_map_next",
22+
"-Wclippy::flat_map_option",
23+
"-Wclippy::float_cmp_const",
24+
"-Wclippy::fn_params_excessive_bools",
25+
"-Wclippy::from_iter_instead_of_collect",
26+
"-Wclippy::if_let_mutex",
27+
"-Wclippy::implicit_clone",
28+
"-Wclippy::imprecise_flops",
29+
"-Wclippy::inefficient_to_string",
30+
"-Wclippy::invalid_upcast_comparisons",
31+
"-Wclippy::large_digit_groups",
32+
"-Wclippy::large_stack_arrays",
33+
"-Wclippy::large_types_passed_by_value",
34+
"-Wclippy::let_unit_value",
35+
"-Wclippy::linkedlist",
36+
"-Wclippy::lossy_float_literal",
37+
"-Wclippy::macro_use_imports",
38+
"-Wclippy::manual_ok_or",
39+
"-Wclippy::map_err_ignore",
40+
"-Wclippy::map_flatten",
41+
"-Wclippy::map_unwrap_or",
42+
"-Wclippy::match_on_vec_items",
43+
"-Wclippy::match_same_arms",
44+
"-Wclippy::match_wild_err_arm",
45+
"-Wclippy::match_wildcard_for_single_variants",
46+
"-Wclippy::mem_forget",
47+
"-Wclippy::mismatched_target_os",
48+
"-Wclippy::missing_enforced_import_renames",
49+
"-Wclippy::mut_mut",
50+
"-Wclippy::mutex_integer",
51+
"-Wclippy::needless_borrow",
52+
"-Wclippy::needless_continue",
53+
"-Wclippy::needless_for_each",
54+
"-Wclippy::option_option",
55+
"-Wclippy::path_buf_push_overwrite",
56+
"-Wclippy::ptr_as_ptr",
57+
"-Wclippy::rc_mutex",
58+
"-Wclippy::ref_option_ref",
59+
"-Wclippy::rest_pat_in_fully_bound_structs",
60+
"-Wclippy::same_functions_in_if_condition",
61+
"-Wclippy::semicolon_if_nothing_returned",
62+
"-Wclippy::single_match_else",
63+
"-Wclippy::string_add_assign",
64+
"-Wclippy::string_add",
65+
"-Wclippy::string_lit_as_bytes",
66+
"-Wclippy::string_to_string",
67+
"-Wclippy::todo",
68+
"-Wclippy::trait_duplication_in_bounds",
69+
"-Wclippy::unimplemented",
70+
"-Wclippy::unnested_or_patterns",
71+
"-Wclippy::unused_self",
72+
"-Wclippy::useless_transmute",
73+
"-Wclippy::verbose_file_reads",
74+
"-Wclippy::zero_sized_map_values",
75+
"-Wfuture_incompatible",
76+
"-Wnonstandard_style",
77+
"-Wrust_2018_idioms",
78+
# END - Embark standard lints v6 for Rust 1.55+
79+
]
80+
81+
[target.'cfg(target_env = "musl")']
82+
rustflags = ["-C", "target-feature=+crt-static"]

.github/workflows/rust-ci.yml

Lines changed: 25 additions & 161 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
1-
# TODO: Replace this line with the commented ones to actually run the action in your repo(s)
2-
on: public
3-
# on:
4-
# push:
5-
# branches:
6-
# - main
7-
# tags:
8-
# - "*"
9-
# pull_request:
1+
on:
2+
push:
3+
branches:
4+
- main
5+
tags:
6+
- "*"
7+
pull_request:
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
11+
cancel-in-progress: true
1012

1113
name: CI
1214
jobs:
1315
lint:
1416
name: Lint
15-
runs-on: ubuntu-latest
17+
runs-on: ubuntu-22.04
1618
steps:
17-
- uses: actions/checkout@v3
18-
- uses: actions-rs/toolchain@v1
19-
with:
20-
toolchain: stable
21-
override: true
19+
- uses: actions/checkout@v4
20+
- uses: dtolnay/rust-toolchain@stable
2221

2322
# make sure all code has been formatted with rustfmt
2423
- name: check rustfmt
@@ -35,164 +34,29 @@ jobs:
3534
3635
test:
3736
name: Test
38-
strategy:
39-
matrix:
40-
os: [ubuntu-latest, windows-latest, macOS-latest]
41-
runs-on: ${{ matrix.os }}
37+
runs-on: ubuntu-22.04
4238
steps:
43-
- uses: actions/checkout@v3
44-
- uses: actions-rs/toolchain@v1
45-
with:
46-
toolchain: stable
47-
override: true
39+
- uses: actions/checkout@v4
40+
- uses: dtolnay/rust-toolchain@stable
4841
- run: cargo fetch
4942
- name: cargo test build
50-
# Note the use of release here means longer compile time, but much
51-
# faster test execution time. If you don't have any heavy tests it
52-
# might be faster to take off release and just compile in debug
53-
run: cargo build --tests --release
43+
run: cargo build --tests
5444
- name: cargo test
55-
run: cargo test --release
45+
run: cargo test
5646

57-
# TODO: Remove this check if you don't use cargo-deny in the repo
5847
deny-check:
5948
name: cargo-deny
60-
runs-on: ubuntu-latest
49+
runs-on: ubuntu-22.04
6150
steps:
62-
- uses: actions/checkout@v3
51+
- uses: actions/checkout@v4
6352
- uses: EmbarkStudios/cargo-deny-action@v1
6453

65-
# TODO: Remove this check if you don't publish the crate(s) from this repo
6654
publish-check:
6755
name: Publish Check
68-
runs-on: ubuntu-latest
56+
runs-on: ubuntu-22.04
6957
steps:
70-
- uses: actions/checkout@v3
71-
- uses: actions-rs/toolchain@v1
72-
with:
73-
toolchain: stable
74-
override: true
58+
- uses: actions/checkout@v4
59+
- uses: dtolnay/rust-toolchain@stable
7560
- run: cargo fetch
7661
- name: cargo publish check
77-
run: cargo publish --dry-run
78-
79-
# TODO: Remove this job if you don't release binaries
80-
# Replace occurances of $BIN_NAME with the name of your binary
81-
release:
82-
name: Release
83-
needs: [test, deny-check]
84-
if: startsWith(github.ref, 'refs/tags/')
85-
strategy:
86-
matrix:
87-
os: [ubuntu-latest, macOS-latest, windows-latest]
88-
include:
89-
- os: ubuntu-latest
90-
rust: stable
91-
target: x86_64-unknown-linux-musl
92-
bin: $BIN_NAME
93-
# We don't enable the progress feature when targeting
94-
# musl since there are some dependencies on shared libs
95-
features: ""
96-
- os: windows-latest
97-
rust: stable
98-
target: x86_64-pc-windows-msvc
99-
bin: $BIN_NAME.exe
100-
features: progress
101-
- os: macOS-latest
102-
rust: stable
103-
target: x86_64-apple-darwin
104-
bin: $BIN_NAME
105-
features: progress
106-
runs-on: ${{ matrix.os }}
107-
steps:
108-
- name: Install stable toolchain
109-
uses: actions-rs/toolchain@v1
110-
with:
111-
toolchain: ${{ matrix.rust }}
112-
override: true
113-
target: ${{ matrix.target }}
114-
- name: Install musl tools
115-
if: matrix.os == 'ubuntu-latest'
116-
run: sudo apt-get install -y musl-tools
117-
- name: Checkout
118-
uses: actions/checkout@v3
119-
- run: cargo fetch --target ${{ matrix.target }}
120-
- name: Release build
121-
shell: bash
122-
run: |
123-
if [ "${{ matrix.features }}" != "" ]; then
124-
cargo build --release --target ${{ matrix.target }} --features ${{ matrix.features }}
125-
else
126-
cargo build --release --target ${{ matrix.target }}
127-
fi
128-
- name: Package
129-
shell: bash
130-
run: |
131-
name=$BIN_NAME
132-
tag=$(git describe --tags --abbrev=0)
133-
release_name="$name-$tag-${{ matrix.target }}"
134-
release_tar="${release_name}.tar.gz"
135-
mkdir "$release_name"
136-
137-
if [ "${{ matrix.target }}" != "x86_64-pc-windows-msvc" ]; then
138-
strip "target/${{ matrix.target }}/release/${{ matrix.bin }}"
139-
fi
140-
141-
cp "target/${{ matrix.target }}/release/${{ matrix.bin }}" "$release_name/"
142-
cp README.md LICENSE-APACHE LICENSE-MIT "$release_name/"
143-
tar czvf "$release_tar" "$release_name"
144-
145-
rm -r "$release_name"
146-
147-
# Windows environments in github actions don't have the gnu coreutils installed,
148-
# which includes the shasum exe, so we just use powershell instead
149-
if [ "${{ matrix.os }}" == "windows-latest" ]; then
150-
echo "(Get-FileHash \"${release_tar}\" -Algorithm SHA256).Hash | Out-File -Encoding ASCII -NoNewline \"${release_tar}.sha256\"" | pwsh -c -
151-
else
152-
echo -n "$(shasum -ba 256 "${release_tar}" | cut -d " " -f 1)" > "${release_tar}.sha256"
153-
fi
154-
- name: Publish
155-
uses: softprops/action-gh-release@v1
156-
with:
157-
draft: true
158-
files: "$BIN_NAME*"
159-
env:
160-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
161-
162-
# TODO: Remove this job if you don't publish container images on each release
163-
# TODO: Create a repository on DockerHub with the same name as the GitHub repo
164-
# TODO: Add the new repo to the buildbot group with read & write permissions
165-
# TODO: Add the embarkbot dockerhub password to the repo secrets as DOCKERHUB_PASSWORD
166-
publish-container-images:
167-
name: Publish container images
168-
runs-on: ubuntu-latest
169-
if: startsWith(github.ref, 'refs/tags/')
170-
needs: [test, deny-check]
171-
steps:
172-
- name: Checkout
173-
uses: actions/checkout@v3
174-
- name: Set up QEMU
175-
uses: docker/setup-qemu-action@v1
176-
- name: Set up Docker Buildx
177-
uses: docker/setup-buildx-action@v1
178-
- name: Login to Dockerhub
179-
uses: docker/login-action@v1
180-
with:
181-
username: embarkbot
182-
password: ${{ secrets.DOCKERHUB_PASSWORD }}
183-
- name: Docker meta
184-
id: docker_meta
185-
uses: crazy-max/ghaction-docker-meta@v1
186-
with:
187-
images: embarkstudios/${{ github.event.repository.name }}
188-
tag-semver: |
189-
{{version}}
190-
{{major}}.{{minor}}
191-
- name: Build and push
192-
uses: docker/build-push-action@v2
193-
with:
194-
context: .
195-
file: ./Dockerfile
196-
push: true
197-
tags: ${{ steps.docker_meta.outputs.tags }}
198-
labels: ${{ steps.docker_meta.outputs.labels }}
62+
run: cargo publish --dry-run -p toml-span

.github/workflows/rustdoc-pages.yml

Lines changed: 0 additions & 64 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
/target
2-
**/*.rs.bk
3-
Cargo.lock
2+
**.snap.new

.mergify.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)