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

Commit

Permalink
Merge pull request #20 from Setheum-Labs/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
balqaasem authored Oct 17, 2022
2 parents 150e15d + 77e82a6 commit 2867166
Show file tree
Hide file tree
Showing 213 changed files with 22,848 additions and 381 deletions.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2
updates:
- package-ecosystem: cargo
directory: /
schedule:
interval: weekly

- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
25 changes: 25 additions & 0 deletions .github/workflows/cargo-audit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: cargo-audit

on:
pull_request:
paths:
- '**/Cargo.toml'
- '**/Cargo.lock'
- '.github/workflows/cargo-audit.yml'

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

jobs:
build:
name: Run `cargo-audit`
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v2

- name: Run `cargo-audit`
uses: actions-rs/audit-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
28 changes: 28 additions & 0 deletions .github/workflows/check-version-bumped-consensus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Version bump check for code changes in the stance-consensus package

on:
pull_request:
branches:
- main
paths:
- 'consensus/src/**'

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

jobs:
check-version-bumped-consensus:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: check-cargo-toml-version-bumped
run: |
if ! git diff HEAD origin/main -- consensus/Cargo.toml | grep -q '^+version ='; then
echo "None of commits in this PR has changed version in consensus/Cargo.toml!"
exit 1
fi
shell: bash
28 changes: 28 additions & 0 deletions .github/workflows/check-version-bumped-crypto.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Version bump check for code changes in the stance-crypto package

on:
pull_request:
branches:
- main
paths:
- 'utils/crypto/src/**'

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

jobs:
check-version-bumped-crypto:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: check-cargo-toml-version-bumped
run: |
if ! git diff HEAD origin/main -- crypto/Cargo.toml | grep -q '^+version ='; then
echo "None of commits in this PR has changed version in crypto/Cargo.toml!"
exit 1
fi
shell: bash
28 changes: 28 additions & 0 deletions .github/workflows/check-version-bumped-mock.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Version bump check for code changes in the stance-mock package

on:
pull_request:
branches:
- main
paths:
- 'utils/mock/src/**'

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

jobs:
check-version-bumped-mock:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: check-cargo-toml-version-bumped
run: |
if ! git diff HEAD origin/main -- mock/Cargo.toml | grep -q '^+version ='; then
echo "None of commits in this PR has changed version in mock/Cargo.toml!"
exit 1
fi
shell: bash
28 changes: 28 additions & 0 deletions .github/workflows/check-version-bumped-rmc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Version bump check for code changes in the stance-rmc package

on:
pull_request:
branches:
- main
paths:
- 'reliable-broadcast/rmc/src/**'

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

jobs:
check-version-bumped-rmc:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: check-cargo-toml-version-bumped
run: |
if ! git diff HEAD origin/main -- rmc/Cargo.toml | grep -q '^+version ='; then
echo "None of commits in this PR has changed version in rmc/Cargo.toml!"
exit 1
fi
shell: bash
28 changes: 28 additions & 0 deletions .github/workflows/check-version-bumped-types.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Version bump check for code changes in the stance-types package

on:
pull_request:
branches:
- main
paths:
- 'utils/types/src/**'

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

jobs:
check-version-bumped-types:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: check-cargo-toml-version-bumped
run: |
if ! git diff HEAD origin/main -- types/Cargo.toml | grep -q '^+version ='; then
echo "None of commits in this PR has changed version in types/Cargo.toml!"
exit 1
fi
shell: bash
76 changes: 76 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: CI

on:
push:
pull_request:

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

env:
CARGO_TERM_COLOR: always

defaults:
run:
shell: bash

jobs:
pr:
name: pull_request
if: "github.event_name == 'pull_request'"
runs-on: ubuntu-20.04
needs: lint
steps:
- name: checkout the source code
uses: actions/checkout@v2
- name: install rustup
uses: actions-rs/toolchain@v1
- name: check
uses: actions-rs/cargo@v1
with:
command: check
- name: test
uses: actions-rs/cargo@v1
with:
command: test
args: '--lib'
master:
name: push
if: "github.event_name == 'push'"
runs-on: ubuntu-20.04
needs: lint
steps:
- name: checkout the source code
uses: actions/checkout@v2
- name: install rustup
uses: actions-rs/toolchain@v1
- name: check
uses: actions-rs/cargo@v1
with:
command: check
- name: test
uses: actions-rs/cargo@v1
with:
command: test
args: '--lib'
lint:
name: lint
runs-on: ubuntu-20.04
steps:
- name: checkout the source code
uses: actions/checkout@v2
- name: install rustup
uses: actions-rs/toolchain@v1
with:
components: rustfmt, clippy
- name: fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-targets --all-features -- -D warnings -A clippy::type_complexity
28 changes: 28 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: github pages

on:
push:
branches:
- main
paths:
- 'docs/**'
- '.github/workflows/gh-pages.yml'

jobs:
deploy:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Setup mdBook
uses: peaceiris/actions-mdbook@v1
with:
mdbook-version: '0.4.8'
- name: Build the book
working-directory: ./docs
run: mdbook build
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/book
16 changes: 16 additions & 0 deletions .github/workflows/post-dod-checklist.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Post DoD checklist
on: [pull_request_target]
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: wow-actions/auto-comment@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
pullRequestOpened: |
Please make sure the following happened
- [ ] Appropriate tests created
- [ ] Infrastructure updated accordingly
- [ ] Updated existing documentation
- [ ] New documentation created
- [ ] Version bumped if breaking changes
19 changes: 19 additions & 0 deletions .github/workflows/push-foundation-repo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Sync Setheum-Labs repo with Setheum-Foundation repo

on:
push:
branches:
- main

jobs:
sync:
runs-on: ubuntu-latest
if: ${{ github.repository == 'Setheum-Labs/Stance'}}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
ref: "main"
token: ${{ secrets.SYNCAZF }}
- name: Push to Setheum-Foundation
run: git push https://x-access-token:${{ secrets.SYNCAZF }}@github.com/setheum-foundation/Stance.git
21 changes: 18 additions & 3 deletions Cargo.dev.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,26 @@ cargo-features = ["resolver"]

[workspace]
members = [
"example",
"example",
"example",
# Core
"consensus",
"finality/finality-companion",
"finality/finality-gadget",
"reliable-broadcast/rmc",
"reliable-broadcast/rmc-aggregator",

# Utils
"utils/crypto",
"utils/examples/ordering",
"utils/examples/blockchain",
"utils/fuzz",
"utils/mock",
"utils/types",

]
resolver = "2"

[profile.dev]
split-debuginfo = "unpacked"

[profile.test]
opt-level = 3
8 changes: 0 additions & 8 deletions bft-engine/aggregator/Cargo.toml

This file was deleted.

3 changes: 0 additions & 3 deletions bft-engine/aggregator/src/main.rs

This file was deleted.

6 changes: 0 additions & 6 deletions bft-engine/consensus/stance-bft/README.md

This file was deleted.

Loading

0 comments on commit 2867166

Please sign in to comment.