-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'add-registry-validate' into add-ipfs-uploader
- Loading branch information
Showing
12 changed files
with
81 additions
and
2,622 deletions.
There are no files selected for viewing
File renamed without changes.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/env rust-script | ||
//! ```cargo | ||
//! [dependencies] | ||
//! serde_json = "1.0.128" | ||
//! bothan-core = "0.0.1-alpha.3" | ||
//! ``` | ||
use std::env; | ||
use std::fs::File; | ||
use std::io::BufReader; | ||
use std::path::Path; | ||
|
||
use bothan_core::registry::{Invalid, Registry}; | ||
|
||
fn main() { | ||
let args = env::args().collect::<Vec<String>>(); | ||
if args.len() != 2 { | ||
eprintln!("unexpected arguments: {:?}", args); | ||
std::process::exit(1); | ||
} | ||
|
||
let path = Path::new(args[1].as_str()); | ||
let registry: Registry<Invalid> = { | ||
let file = File::open(path).expect("Failed to open registry file"); | ||
let reader = BufReader::new(file); | ||
serde_json::from_reader(reader).expect("Failed to parse registry file") | ||
}; | ||
registry.validate().expect("Registry is invalid"); | ||
|
||
println!("Registry is valid"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Aggregate Signals | ||
|
||
on: | ||
push: | ||
|
||
jobs: | ||
aggregate-signal: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11.2' | ||
|
||
- name: Install Python Dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install pyyaml | ||
- name: Aggregate Signals | ||
run: python .github/scripts/merge_all.py ./signals . | ||
|
||
- name: Cache Rust-Script | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.cache/rust-script | ||
key: ${{ runner.os }}-rust-script-${{ hashFiles('.github/scripts/validate.rs') }} | ||
restore-keys: | | ||
${{ runner.os }}-rust-script-${{ hashFiles('.github/scripts/validate.rs') }} | ||
- name: Setup Rust Toolchain | ||
uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
|
||
- name: Install Rust Script | ||
run: cargo install rust-script | ||
|
||
- name: Install Dependencies | ||
run: sudo apt update && sudo apt-get install clang -y | ||
|
||
- name: Validate Aggregated Signals | ||
run: .github/scripts/validate.rs registry.json | ||
|
||
- name: Commit | ||
uses: stefanzweifel/git-auto-commit-action@v5 | ||
with: | ||
commit_message: aggregated signals |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.