Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1 from radixdlt/migrate_from_other_repo
Browse files Browse the repository at this point in the history
  • Loading branch information
CyonAlexRDX authored Sep 2, 2024
2 parents e4c0500 + 1105c1f commit 29b33b9
Show file tree
Hide file tree
Showing 104 changed files with 10,846 additions and 4 deletions.
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
RUST_LOG=error
91 changes: 91 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# Testing CI - Runs on each PR and Push

name: Test
on:
pull_request:
push:
branches:
- main

permissions:
id-token: write
contents: read
env:
CARGO_TERM_COLOR: always
RUST_TOOLCHAIN: nightly-2024-01-11
RUST_COMPONENTS: "rust-std"
jobs:
# cargo fmt check
check-formatting:
runs-on: ubuntu-latest
steps:
- uses: RDXWorks-actions/checkout@main

- name: Install Rust Toolchain
uses: RDXWorks-actions/toolchain@master
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
default: true
components: rustfmt

- name: Check formatting
run: cargo fmt --check

# clippy
check-clippy:
runs-on: ubuntu-latest
steps:
- uses: RDXWorks-actions/checkout@main

- name: Install Rust Toolchain
uses: RDXWorks-actions/toolchain@master
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
default: true
components: clippy

- name: Clippy Check
run: cargo clippy --all

# Rust unit, doc and integration
test-rust:
runs-on: ubuntu-latest
steps:
- uses: RDXWorks-actions/checkout@main

- name: Install Rust Toolchain
uses: RDXWorks-actions/toolchain@master
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
default: true

- name: Run rust tests
run: cargo test

# Code Coverage uses Tarpaulin and uploads to CodeCov.io
code-coverage:
runs-on: ubuntu-latest
steps:
- uses: RDXWorks-actions/checkout@main

- name: Install Rust Toolchain
uses: RDXWorks-actions/toolchain@master
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
default: true

- name: Install cargo tarpaulin
uses: RDXWorks-actions/cargo-install@main
with:
crate: cargo-tarpaulin
tag: 0.30.0
locked: true

- name: Code Coverage - Generate
run: cargo tarpaulin --out xml

- name: Code Coverage - Upload to CodeCov.io
uses: RDXWorks-actions/codecov-action@main
with:
token: ${{ secrets.CODECOV }}
fail_ci_if_error: true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target
tarpaulin-report.*
29 changes: 29 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
fail_fast: true

repos:
- repo: https://github.com/crate-ci/typos
rev: v1.24.1
hooks:
- id: typos
- repo: local
hooks:
- id: fmt
name: fmt
language: system
types: [file, rust]
entry: cargo fmt -- --check
pass_filenames: false

- id: clippy
name: clippy
language: system
types: [file, rust]
entry: cargo clippy --all -- -D warnings # Use -D warnings option to ensure the job fails when encountering warnings
pass_filenames: false

- id: unit tests
name: unit tests
language: system
types: [file, rust]
entry: cargo test --lib
pass_filenames: false
9 changes: 9 additions & 0 deletions .tarpaulin.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[all]
exclude-files = ["src/types/sargon_types.rs", "src/testing/*", "src/samples/*"]
verbose = false
force-clean = true
timeout = "2m"
locked = true
all-features = true
jobs = 1
out = ["Html"]
46 changes: 46 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "Debug unit tests in library 'signing'",
"cargo": {
"args": [
"test",
"--no-run",
"--lib",
"--package=signing"
],
"filter": {
"name": "signing",
"kind": "lib"
}
},
"args": [],
"cwd": "${workspaceFolder}"
},
{
"type": "lldb",
"request": "launch",
"name": "Debug integration test 'main'",
"cargo": {
"args": [
"test",
"--no-run",
"--test=main",
"--package=signing"
],
"filter": {
"name": "main",
"kind": "test"
}
},
"args": [],
"cwd": "${workspaceFolder}"
}
]
}
18 changes: 18 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"cSpell.words": [
"Caprese",
"FACTORINSTANCE",
"FACTORSOURCE",
"interactor",
"Interactors",
"Keyrings",
"preprocess",
"Quartier",
"Rémy",
"substate",
"txid",
"txids",
"unsecurified",
"Yubikey"
]
}
Loading

0 comments on commit 29b33b9

Please sign in to comment.