Skip to content

Commit

Permalink
✨ cleanup and improve features (#1)
Browse files Browse the repository at this point in the history
* feat: clean code

* feat: load starknet config

* feat: price deviation from coingecko

* fix: logger

* feat: deviation from on-chain median

* feat: num sources metric

* fix: remove some unwraps

* feat: update coingecko mapping

* feat: ci

* fix: linters

* feat: llama api + some fixes

* fix: deviation

* fix: clippy
  • Loading branch information
EvolveArt authored Dec 15, 2023
1 parent 64d4019 commit 6530762
Show file tree
Hide file tree
Showing 31 changed files with 1,603 additions and 606 deletions.
11 changes: 10 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,2 +1,11 @@
# The database URL the application will use to connect to the database.
DATABASE_URL='postgres://postgres:A+T|oiWbuK02OwLG:8rAdF7LT~b-@testnet-aurora.proxy-cusx5kdiz1ia.eu-west-3.rds.amazonaws.com/indexed_data?sslmode=disable'
DATABASE_URL='postgres://postgres:postgres@localhost:5432/postgres'

# RPC URLS
TESTNET_RPC_URL=
MAINNET_RPC_URL=

# Config
NETWORK=testnet
ORACLE_ADDRESS=0x
PAIRS=BTC/USD,ETH/USD
23 changes: 23 additions & 0 deletions .github/workflows/linters-cargo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: Task - Linters Cargo

on:
workflow_dispatch:
workflow_call:

jobs:
cargo-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

# selecting a toolchain either by action or manual `rustup` calls should happen
# before the plugin, as the cache uses the current rustc version as its cache key
- run: rustup show

- uses: Swatinem/rust-cache@v2
- name: Format and clippy
run: |
cargo fmt -- --check
cargo clippy --no-deps -- -D warnings
cargo clippy --tests --no-deps -- -D warnings
33 changes: 33 additions & 0 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: Task - Linters

on:
workflow_dispatch:
workflow_call:

jobs:
prettier:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run prettier
run: |-
npx prettier --check .
markdown-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: avto-dev/markdown-lint@v1
with:
config: "./.markdownlint.json"
args: "."
ignore: "./target"

toml-lint:
runs-on: ubuntu-latest
steps:
- name: Checkout toml files
uses: actions/checkout@v3
- name: Run toml check
run: npx @taplo/cli fmt --config ./taplo/taplo.toml --check
23 changes: 23 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: Workflow - Pull Request

on:
workflow_dispatch:
pull_request:
branches: [main]
push:
branches: [main]

jobs:
linters:
name: Run linters
uses: ./.github/workflows/linters.yml

rust_build:
name: Build Rust project
uses: ./.github/workflows/rust-build.yml

linters_cargo:
name: Run Cargo linters
uses: ./.github/workflows/linters-cargo.yml
needs: rust_build
22 changes: 22 additions & 0 deletions .github/workflows/rust-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: Task - Build Rust

on:
workflow_dispatch:
workflow_call:

jobs:
rust_build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

# selecting a toolchain either by action or manual `rustup` calls should happen
# before the plugin, as the cache uses the current rustc version as its cache key
- run: rustup show

- uses: Swatinem/rust-cache@v2

- name: Build the project
run: |
cargo build --release --workspace
7 changes: 2 additions & 5 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
{
"rust-analyzer.linkedProjects": [
"Cargo.toml",
"./Cargo.toml"
]
}
"rust-analyzer.linkedProjects": ["Cargo.toml", "./Cargo.toml"]
}
Loading

0 comments on commit 6530762

Please sign in to comment.