-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ba05a8a
commit a2db422
Showing
12 changed files
with
703 additions
and
219 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Bloat Summary | ||
|
||
## Largest functions | ||
|
||
``` | ||
${BLOAT_FUNC} | ||
``` | ||
|
||
## Largest crates | ||
|
||
``` | ||
${BLOAT_CRATE} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Run `cargo bloat` for finding out what takes most of the space in your executable. | ||
|
||
name: Cargo Bloat | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
bloat: | ||
name: Cargo Bloat | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: taiki-e/checkout-action@v1 | ||
|
||
- name: Cache | ||
uses: Swatinem/rust-cache@v2 | ||
|
||
- name: Install cargo-bloat | ||
uses: taiki-e/install-action@v2 | ||
with: | ||
tool: cargo-bloat | ||
|
||
- name: Run | ||
run: | | ||
export CMD="cargo bloat" | ||
# Get largest functions | ||
export BLOAT_FUNC_CMD="${CMD} -n 10" | ||
export BLOAT_FUNC=`${BLOAT_FUNC_CMD}` | ||
echo "${BLOAT_FUNC}" | ||
# Get largest crates | ||
export BLOAT_CRATE_CMD="${CMD} --crates -n 10" | ||
export BLOAT_CRATE=`${BLOAT_CRATE_CMD}` | ||
echo "${BLOAT_CRATE}" | ||
# Render summary | ||
envsubst < .github/workflows/bloat.tmpl > $GITHUB_STEP_SUMMARY |
2 changes: 1 addition & 1 deletion
2
.github/workflows/release.yml → .github/workflows/changeset.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: release | ||
name: changeset | ||
on: | ||
push: | ||
branches: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
name: CI | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
types: [opened, synchronize] | ||
paths-ignore: | ||
- "**/*.md" | ||
- "**/*.yml" | ||
- "!.github/workflows/ci.yml" | ||
push: | ||
branches: | ||
- main | ||
- "renovate/**" | ||
paths-ignore: | ||
- "**/*.md" | ||
- "**/*.yml" | ||
- "!.github/workflows/ci.yml" | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} | ||
cancel-in-progress: ${{ github.ref_name != 'main' }} | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
env: | ||
CARGO_INCREMENTAL: 0 | ||
RUSTFLAGS: "-D warnings" | ||
|
||
jobs: | ||
test: | ||
name: Test | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
# - os: windows-latest | ||
- os: ubuntu-latest | ||
- os: macos-14 | ||
runs-on: ${{ matrix.os }} | ||
env: | ||
# https://github.com/mozilla/sccache/blob/main/docs/S3.md | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
SCCACHE_BUCKET: ${{ secrets.SCCACHE_BUCKET }} | ||
SCCACHE_ENDPOINT: ${{ secrets.SCCACHE_ENDPOINT }} | ||
SCCACHE_REGION: auto | ||
RUSTC_WRAPPER: ${{ vars.USE_SCCACHE == 'true' && 'sccache' || '' }} | ||
CARGO_INCREMENTAL: 0 | ||
SCCACHE_LOCAL_RW_MODE: | ||
steps: | ||
- uses: taiki-e/checkout-action@v1 | ||
- uses: Boshen/setup-rust@main | ||
with: | ||
# warm cache factory for all other CI jobs | ||
# cache `target` directory to avoid download crates | ||
save-cache: ${{ github.ref_name == 'main' }} | ||
cache-key: warm | ||
# cache build outputs to speed up compilation | ||
- uses: mozilla-actions/[email protected] | ||
if: ${{ vars.USE_SCCACHE == 'true' }} | ||
- run: cargo test --no-run | ||
- run: cargo test | ||
- run: cargo ck | ||
|
||
typos: | ||
name: Spell Check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: taiki-e/checkout-action@v1 | ||
- uses: crate-ci/typos@master | ||
with: | ||
files: . | ||
|
||
deny: | ||
name: Cargo Deny | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: taiki-e/checkout-action@v1 | ||
|
||
- uses: dorny/paths-filter@v3 | ||
id: filter | ||
with: | ||
filters: | | ||
src: | ||
- 'Cargo.lock' | ||
- uses: Boshen/setup-rust@main | ||
if: steps.filter.outputs.src == 'true' | ||
with: | ||
restore-cache: false | ||
tools: cargo-deny | ||
|
||
- if: steps.filter.outputs.src == 'true' | ||
run: cargo deny check | ||
|
||
unused-deps: | ||
name: Check Unused Dependencies | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: taiki-e/checkout-action@v1 | ||
- uses: dorny/paths-filter@v3 | ||
id: filter | ||
with: | ||
filters: | | ||
src: | ||
- '**/*.rs' | ||
- '**/Cargo.toml' | ||
- 'Cargo.lock' | ||
- uses: Boshen/setup-rust@main | ||
with: | ||
restore-cache: false | ||
if: steps.filter.outputs.src == 'true' | ||
- uses: cargo-bins/cargo-binstall@main | ||
if: steps.filter.outputs.src == 'true' | ||
- run: cargo binstall --no-confirm cargo-shear | ||
if: steps.filter.outputs.src == 'true' | ||
- run: cargo shear | ||
if: steps.filter.outputs.src == 'true' | ||
|
||
format: | ||
name: Format | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: taiki-e/checkout-action@v1 | ||
- uses: Boshen/setup-rust@main | ||
with: | ||
components: rustfmt | ||
restore-cache: false | ||
- run: cargo fmt --all -- --check | ||
|
||
lint: | ||
name: Clippy | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: taiki-e/checkout-action@v1 | ||
- uses: Boshen/setup-rust@main | ||
with: | ||
components: clippy | ||
- run: cargo lint -- -D warnings | ||
|
||
doc: | ||
name: Doc | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: taiki-e/checkout-action@v1 | ||
- uses: Boshen/setup-rust@main | ||
with: | ||
components: rust-docs | ||
- run: RUSTDOCFLAGS='-D warnings' cargo doc --no-deps --document-private-items |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Release Crates | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- Cargo.toml | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
release: | ||
name: Release crates | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: taiki-e/checkout-action@v1 | ||
- run: cargo publish --token ${{ secrets.CARGO_REGISTRY_TOKEN }} |
Oops, something went wrong.