Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 28 additions & 16 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,36 +8,48 @@ charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 4
insert_final_newline = false
insert_final_newline = true
quote_type = double
trim_trailing_whitespace = false

[*.{ts,tsx,js,jsx,cjs,mjs}]
indent_size = 2
quote_type = single
trim_trailing_whitespace = true

# Common config files
[*.{json,yaml,yml,toml}]
indent_size = 2

[*.{md,mdx}]
indent_size = 2

[*{toml}]
end_of_line = lf
# scripts
[*.{sh,bat}]
indent_size = 2

[*.md]
insert_final_newline = true
trim_trailing_whitespace = true
trim_trailing_whitespace = false

# Rust files
[*.rs]
indent_size = 4

# Python files
[*.py]
indent_size = 4

# WebAssembly files
[*.{wat,wit}]
indent_size = 4
insert_final_newline = false

# Markdown files
[*.{md,mdx}]
indent_size = 2

# WebDev

## JavaScript / TypeScript
[*.{ts,tsx,js,jsx,cjs,mjs}]
indent_size = 2

## HTML / XML
[*.{html,htm,xml}]
indent_size = 2

## Stylesheets
[*.{css,scss,sass,less}]
indent_size = 2
trim_trailing_whitespace = true
insert_final_newline = true

67 changes: 0 additions & 67 deletions .github/workflows/cargo-bench.yml

This file was deleted.

24 changes: 11 additions & 13 deletions .github/workflows/cargo-clippy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,36 +14,34 @@ on:
types: [clippy, cargo-clippy]
workflow_dispatch:

permissions:
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
contents: read
security-events: write
statuses: write

jobs:
clippy:
runs-on: ubuntu-latest
permissions:
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
contents: read
security-events: write
statuses: write
steps:
- uses: actions/checkout@v6
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
repository: ${{ github.repository }}
ref: ${{ github.event.client_payload.ref || github.ref }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
cache-key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
components: clippy,rustfmt
- uses: taiki-e/install-action@v2
- name: Install SARIF tools
uses: taiki-e/install-action@v2
with:
tool: clippy-sarif sarif-fmt
- name: Run Clippy
- name: Run cargo clippy
run: |
cargo clippy \
--features full \
--message-format=json | clippy-sarif | tee rust-clippy-results.sarif | sarif-fmt
- name: Upload analysis
- name: Upload the results
uses: github/codeql-action/upload-sarif@v4
with:
sarif_file: rust-clippy-results.sarif
Expand Down
23 changes: 13 additions & 10 deletions .github/workflows/cargo-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,33 @@ concurrency:
cancel-in-progress: false
group: ${{ github.workflow }}-${{ github.ref }}

env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full

on:
release:
types: [published]
repository_dispatch:
types: [crates-io, cargo-publish]
workflow_dispatch:

env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full

permissions:
contents: read
deployments: write

jobs:
crates-io:
environment: crates-io
runs-on: ubuntu-latest
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
environment:
name: crates-io
url: https://crates.io/crates/${{ matrix.package }}
strategy:
fail-fast: false
max-parallel: 1
matrix:
package:
# sdk
- rstmt-traits
- rstmt-core
- rstmt-nrt
Expand All @@ -40,12 +41,14 @@ jobs:
uses: actions/checkout@v6
with:
fetch-depth: 0
ref: ${{ github.event.client_payload.ref || github.ref }}
repository: ${{ github.event.client_payload.repository || github.repository }}
token: ${{ secrets.GITHUB_TOKEN }}
ref: ${{ github.event.client_payload.ref || github.ref }}
repository: ${{ github.repository }}
token: ${{ github.token }}
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
cache-key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Publish (${{ matrix.package }})
run: cargo publish --locked --package ${{ matrix.package }}
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
12 changes: 7 additions & 5 deletions .github/workflows/cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,14 @@ on:
types: [closed]

jobs:
cache_cleanup:
pr_cache_cleanup:
if: github.event.pull_request.merged == true
name: Cleanup Pull Request Caches
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
BRANCH: refs/pull/${{ github.event.pull_request.number }}/merge
permissions:
actions: write
steps:
Expand All @@ -23,7 +29,3 @@ jobs:
gh cache delete $cacheKey
done
echo "Done"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
BRANCH: refs/pull/${{ github.event.pull_request.number }}/merge
8 changes: 3 additions & 5 deletions .github/workflows/nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}

on:
pull_request:
branches: [main, master]
types: [closed, opened, reopened]
push:
branches: [main, master]
tags: [latest, v*.*.*, "*-nightly"]
repository_dispatch:
types: [nix, nix-build]
Expand All @@ -22,10 +20,10 @@ jobs:
continue-on-error: true
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- uses: actions/checkout@v6
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Nix
uses: cachix/install-nix-action@v31
with:
Expand Down
21 changes: 8 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,23 @@ permissions:

jobs:
release:
env:
IS_PRERELEASE: ${{ github.event.inputs.prerelease || false }}
IS_DRAFT: ${{ github.event.inputs.draft || false }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- uses: actions/checkout@v6
with:
fetch-depth: 0
ref: ${{ github.event.client_payload.ref || github.ref }}
repository: ${{ github.repository }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Dispatch & Publish to crates.io
uses: peter-evans/repository-dispatch@v4
with:
event-type: cargo-publish
client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'
token: ${{ secrets.GITHUB_TOKEN }}
- name: Create GitHub Release
ref: ${{ github.ref }}
- name: Create release
uses: softprops/action-gh-release@v2
continue-on-error: true
with:
append_body: false
draft: ${{ inputs.prerelease || github.event.release.prerelease || false }}
prerelease: ${{ inputs.draft || github.event.release.draft || false }}
draft: ${{ env.IS_DRAFT }}
prerelease: ${{ env.IS_PRERELEASE }}
tag_name: ${{ github.event.release.tag_name }}
body: |
${{ github.event.release.body }}
Expand Down
Loading