Skip to content

Commit

Permalink
updated ci workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
NanezX committed Dec 3, 2023
1 parent b0e7c66 commit b8c63a7
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 1 deletion.
45 changes: 44 additions & 1 deletion .github/workflows/subgraph.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,49 @@ jobs:
working-directory: ./subgraph
run: npm install

- name: Initialize and build setup
- name: Initialize setup
working-directory: ./subgraph
run: nix run .#init-setup

- name: Build subgraph
working-directory: ./subgraph
run: nix run .#build

subgraph-test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v4

- uses: DeterminateSystems/magic-nix-cache-action@v2

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Start docker container
working-directory: ./subgraph
run: nix run .#docker-up

- name: Forge shallow install
run: forge install --shallow

- name: install npm dependencies
working-directory: ./subgraph
run: npm install

- name: Initialize setup
working-directory: ./subgraph
run: nix run .#init-setup

- name: Run tests
working-directory: ./subgraph
run: nix run .#ci-test

- name: Stop docker container
working-directory: ./subgraph
run: nix run .#docker-down
12 changes: 12 additions & 0 deletions subgraph/tests/entities.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1,14 @@
mod generated;
mod utils;

use utils::deploy::get_orderbook;

#[tokio::main]
#[test]
async fn test_orderbook_entity() -> anyhow::Result<()> {
let orderbook = get_orderbook().await?;

println!("orderbook: {:?}", orderbook.address());

Ok(())
}

0 comments on commit b8c63a7

Please sign in to comment.