Skip to content

Commit

Permalink
Merge pull request #38 from KasarLabs/net/dev
Browse files Browse the repository at this point in the history
Merge net in prod
  • Loading branch information
0xEniotna authored Oct 7, 2023
2 parents 5bcbedf + d3f08cd commit ec4192f
Show file tree
Hide file tree
Showing 476 changed files with 213,797 additions and 300,678 deletions.
21 changes: 21 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,27 @@
"avatar_url": "https://avatars.githubusercontent.com/u/77340776?v=4",
"profile": "https://www.linkedin.com/in/jo%C3%A3o-pereira-91a087230/",
"contributions": ["doc"]
},
{
"login": "kasteph",
"name": "kasteph",
"avatar_url": "https://avatars.githubusercontent.com/u/3408478?v=4",
"profile": "https://github.com/kasteph",
"contributions": ["code"]
},
{
"login": "ayushtom",
"name": "Ayush Tomar",
"avatar_url": "https://avatars.githubusercontent.com/u/41674634?v=4",
"profile": "https://github.com/ayushtom",
"contributions": ["code"]
},
{
"login": "tchataigner",
"name": "tchataigner",
"avatar_url": "https://avatars.githubusercontent.com/u/9974198?v=4",
"profile": "https://github.com/tchataigner",
"contributions": ["code"]
}
],
"contributorsPerLine": 7,
Expand Down
4 changes: 2 additions & 2 deletions .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ coverage:
status:
patch:
default:
target: 0%
target: 1%
project:
default:
threshold: 0%
threshold: 1%
10 changes: 8 additions & 2 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ jobs:
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
key:
${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}-${{
github.run_id }}
fail-on-cache-miss: true
- name: Run benchmark
run: |
Expand Down Expand Up @@ -67,8 +69,12 @@ jobs:
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
key:
${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}-${{
github.run_id }}
fail-on-cache-miss: true
restore-keys: |
${{ runner.os }}-cargo
- name: Setup rust toolchain
if: steps.cache.outputs.cache-hit != 'true'
run: rustup show
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/configs-verifier.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: Task - Configs Verifier

on:
workflow_dispatch:
workflow_call:

jobs:
genesis-docs:
name: Genesis documentation
runs-on: ubuntu-latest
if: ${{ github.event.label.name != 'ignore-docs' }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Ensure docs changes
run: |
if [[ -n $(git diff --name-only origin/main | grep configs/genesis-assets/genesis.json) ]]; then
git diff --name-only origin/main | grep docs/genesis.md
fi
configs-hashes:
name: Verify genesis-assets hashes
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Verify hashes
run: |
for f in $(find configs/genesis-assets/ -type f -not -path configs/index.json); do
cat configs/index.json | grep $(md5sum $f | awk '{print $1}')
done
38 changes: 38 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Task - Integration Tests

on:
workflow_dispatch:
workflow_call:

jobs:
coverage:
# sadly, for now we have to "rebuild" for the coverage
runs-on: ubuntu-latest-32-cores
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key:
${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}-${{
github.run_id }}
fail-on-cache-miss: true
- name: Setup build deps
run: |
sudo apt-get update
sudo apt-get install -y clang llvm libudev-dev protobuf-compiler
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Coverage
run: cargo llvm-cov --codecov --output-path codecov.json
- name: Upload coverage to codecov.io
uses: codecov/codecov-action@v3
with:
files: codecov.json
fail_ci_if_error: false
9 changes: 8 additions & 1 deletion .github/workflows/linters-cargo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,15 @@ jobs:
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
key:
${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}-${{
github.run_id }}
fail-on-cache-miss: true
restore-keys: |
${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}-${{
github.run_id }}
${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
${{ runner.os }}-cargo
- name: Setup build deps
run: |
sudo apt-get update
Expand Down
18 changes: 0 additions & 18 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,6 @@ jobs:
run: |-
npx prettier --check .
eslint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ">=20"
cache: "npm"
cache-dependency-path: ./tests/package-lock.json
- name: Install
run: |-
cd tests
npm install
- name: Run eslint
run: |-
cd tests
npx eslint .
markdown-lint:
runs-on: ubuntu-latest
steps:
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/madara-commands.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,16 @@ jobs:
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
key:
${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}-${{
github.run_id }}
fail-on-cache-miss: true
- name: Run setup
run: |
target/release/madara setup
- name: Create build-spec (plain)
run: |
target/release/madara build-spec --chain local > chain-plain.json
- name: Create build-spec (raw)
run: |
target/release/madara build-spec --chain chain-plain.json --raw > chain-raw.json
# TODO: add remaining commands
54 changes: 0 additions & 54 deletions .github/workflows/publish-api-ts.yml

This file was deleted.

24 changes: 0 additions & 24 deletions .github/workflows/pull-request-close.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,3 @@ jobs:
steps:
- name: Check out code
uses: actions/checkout@v3

- name: Generate a token
id: generate_token
uses: getsentry/action-github-app-token@v2
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.PRIV_KEY }}

- name: Cleanup
run: |
gh extension install actions/gh-actions-cache
BRANCH="refs/pull/${{ github.event.pull_request.number }}/merge"
echo "Fetching list of cache key"
cacheKeysForPR=$(gh actions-cache list -B $BRANCH --key ${{ runner.os }}-cargo- | cut -f 1 )
set +e
echo "Deleting caches..."
for cacheKey in $cacheKeysForPR
do
echo "Deleting cache $cacheKey"
gh actions-cache delete $cacheKey -B $BRANCH --confirm
done
echo "Done"
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
18 changes: 12 additions & 6 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,19 @@ jobs:
name: Enforce CHANGELOG
uses: ./.github/workflows/changelog.yml

configs-verifier:
name: Verify configs
uses: ./.github/workflows/configs-verifier.yml

linters:
name: Run linters
uses: ./.github/workflows/linters.yml
needs: changelog
needs: [changelog, configs-verifier]

rust_build:
name: Build Rust project
uses: ./.github/workflows/rust-build.yml
needs: changelog
needs: [changelog, configs-verifier]

madara_commands:
name: Test Madara commands
Expand All @@ -31,11 +35,13 @@ jobs:
uses: ./.github/workflows/linters-cargo.yml
needs: rust_build

tests:
name: Run tests and coverage
uses: ./.github/workflows/tests-coverage.yml
needs: [rust_build]
# TODO: Unlock when rust tests are working on main
# coverage:
# name: Run coverage
# uses: ./.github/workflows/coverage.yml
# needs: [madara_commands, linters_cargo]

# https://github.com/keep-starknet-strange/madara/issues/1097
# benchmark:
# name: Run benchmarks
# uses: ./.github/workflows/benchmarks.yml
Expand Down
8 changes: 2 additions & 6 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ jobs:
uses: ./.github/workflows/linters-cargo.yml
needs: rust_build

tests:
name: Run tests and coverage
uses: ./.github/workflows/tests-coverage.yml
needs: [rust_build]

# benchmark:
# name: Run benchmarks
# uses: ./.github/workflows/benchmarks.yml
Expand All @@ -37,9 +32,10 @@ jobs:
# # post on the pull-request page
# pull-requests: write

# TODO change it to benchmark when enabled
rustdoc:
name: Deploy docs to GitHub Pages
uses: ./.github/workflows/rustdoc.yml
needs: tests
needs: linters_cargo
permissions:
contents: write
12 changes: 9 additions & 3 deletions .github/workflows/rust-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Retrieve cached build
id: cache
- name: Cache Cargo registry and git trees
uses: actions/cache@v3
with:
path: |
Expand All @@ -21,7 +20,14 @@ jobs:
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
key:
${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}-${{
github.run_id }}
restore-keys: |
${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}-${{
github.run_id }}
${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
${{ runner.os }}-cargo
- name: Setup rust toolchain
if: steps.cache.outputs.cache-hit != 'true'
Expand Down
Loading

0 comments on commit ec4192f

Please sign in to comment.