Skip to content
Draft
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
91 changes: 55 additions & 36 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,36 +1,55 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

[*]
charset = utf-8
end_of_line = crlf
indent_style = space
indent_size = 4
insert_final_newline = false
quote_type = double
trim_trailing_whitespace = false

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

[*.{json,yaml,yml,toml}]
indent_size = 2

[*.md]
insert_final_newline = true
trim_trailing_whitespace = true

[*.rs]
indent_size = 4

[*.{html,htm,xml}]
indent_size = 2

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

# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

[*]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 4
insert_final_newline = true
quote_type = double
trim_trailing_whitespace = true

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

# scripts
[*.{sh,bat}]
indent_size = 2
insert_final_newline = 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

5 changes: 1 addition & 4 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,4 @@ updates:
interval: monthly
directories:
- /
- /contained
- /core
- /derive
- /macros
- /crates/*
3 changes: 0 additions & 3 deletions .github/workflows/cargo-bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}

on:
push:
branches: [main, master]
tags: [latest, v*.*.*, "*-nightly"]
repository_dispatch:
types: [cargo-bench]
workflow_dispatch:
Expand Down
20 changes: 11 additions & 9 deletions .github/workflows/cargo-clippy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,32 +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:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- 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
107 changes: 55 additions & 52 deletions .github/workflows/cargo-publish.yml
Original file line number Diff line number Diff line change
@@ -1,52 +1,55 @@
name: cargo-publish
# A custom GitHub Actions workflow used to automatically publish Rust crates to crates.io
# whenever a new release is published.

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:

permissions:
contents: read
deployments: write

jobs:
crates-io:
runs-on: ubuntu-latest
environment: crates-io
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
strategy:
fail-fast: false
max-parallel: 1
matrix:
package:
- contained-core
- contained-derive
- contained-macros
- contained
steps:
- name: Checkoout
uses: actions/checkout@v6
with:
fetch-depth: 0
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 }}
name: cargo-publish

concurrency:
cancel-in-progress: false
group: ${{ github.workflow }}-${{ github.ref }}

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:
runs-on: ubuntu-latest
environment:
name: crates-io
url: https://crates.io/crates/${{ matrix.package }}
strategy:
fail-fast: false
max-parallel: 1
matrix:
package:
# sdk
- rstm-traits
- rstm-state
- rstm-tape
- rstm-core
- rstm-macros
- rstm
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
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 }}
72 changes: 72 additions & 0 deletions .github/workflows/cargo-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# This workflow is used to benchmark a Rust project
name: cargo-test
# The workflow may be manually triggered and is run automatically when:
# - a pull request is closed on the default branch (main/master)
# - a release is published
# - a repository_dispatch event with the type "cargo-test" is received

concurrency:
cancel-in-progress: false
group: ${{ github.workflow }}-${{ github.ref }}

on:
repository_dispatch:
types: [cargo-test]
workflow_dispatch:
inputs:
toolchain:
description: 'Rust toolchain to use (stable, beta, nightly, or a specific version)'
required: false
default: 'stable'
type: choice
options: [ stable, nightly, beta]


env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full

permissions:
actions: read
contents: read

jobs:
test:
name: Cargo Test
runs-on: ubuntu-latest
env:
RUST_TOOLCHAIN: ${{ github.event.inputs.toolchain || 'stable' }}
outputs:
status: ${{ steps.test.outputs.status }}
strategy:
fail-fast: false
matrix:
features: [full]
packages: [workspace]
target: [x86_64-unknown-linux-gnu]
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
ref: ${{ github.event.client_payload.ref || github.ref }}
repository: ${{ github.repository }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
cache-key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
toolchain: ${{ env.RUST_TOOLCHAIN }}
override: true
- name: Test workspace (${{ matrix.target }})
id: test
if: matrix.packages == 'workspace' || matrix.packages == 'all'
run: cargo test --locked --verbose --workspace \
--features ${{ matrix.features }} \
--target ${{ matrix.target }}
- name: "Test ${{ matrix.packages }}:${{ matrix.target }}"
id: test-package
if: matrix.packages != 'workspace'
run: cargo test --locked --verbose -p ${{ matrix.packages }} \
--features ${{ matrix.features }} \
--target ${{ matrix.target }}
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: ${{ github.token }}
GH_REPO: ${{ github.repository }}
BRANCH: refs/pull/${{ github.event.pull_request.number }}/merge
8 changes: 5 additions & 3 deletions .github/workflows/nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@ 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:
github_access_token: ${{ github.token}}
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Build
run: nix build
- name: Check the flake
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,16 @@ permissions:

jobs:
release:
runs-on: ubuntu-latest
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
token: ${{ secrets.GITHUB_TOKEN }}
ref: ${{ github.ref }}
- name: Create release
uses: softprops/action-gh-release@v2
continue-on-error: true
Expand Down
Loading
Loading