Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
f85c95f
Script that iterates folders and run tests
JoseRodrigues443 Feb 14, 2022
4776620
Added loop on build
JoseRodrigues443 Feb 14, 2022
8fa1a28
Fixed missed cd to dir
JoseRodrigues443 Feb 14, 2022
96b9671
Addded steps
JoseRodrigues443 Feb 14, 2022
e450558
added debug
JoseRodrigues443 Feb 14, 2022
fce6db0
Added ls
JoseRodrigues443 Feb 14, 2022
4091bb0
Added minor test
JoseRodrigues443 Feb 14, 2022
2a355ff
Added checliht of loop
JoseRodrigues443 Feb 14, 2022
e10d0f0
Removed debug commands
JoseRodrigues443 Feb 14, 2022
e1f30cb
Added working dir
JoseRodrigues443 Feb 14, 2022
196ecfa
Added list files
JoseRodrigues443 Feb 14, 2022
b8efe64
Corrected dir
JoseRodrigues443 Feb 14, 2022
0e8c836
Added check if file exists
JoseRodrigues443 Feb 15, 2022
b01104b
Added no tests message
JoseRodrigues443 Feb 15, 2022
6986326
Fixed script that makes tests
JoseRodrigues443 Feb 15, 2022
3c1d82f
Fixed tests and make them work without RPC confis
JoseRodrigues443 Feb 15, 2022
c72399d
Fixed python agent test
JoseRodrigues443 Feb 15, 2022
ffc567e
Added direct import
JoseRodrigues443 Feb 15, 2022
a00d254
Reverted change
JoseRodrigues443 Feb 15, 2022
a30e525
Removed python pipeline
JoseRodrigues443 Feb 15, 2022
0d2f274
Added pytest warning
JoseRodrigues443 Feb 15, 2022
d8056b4
Merge pull request #1 from JoseRodrigues443/feat/pipeline-for-build
JoseRodrigues443 Feb 15, 2022
266054c
Changed read me for forta
JoseRodrigues443 Feb 15, 2022
2772c76
Revert core alteration
JoseRodrigues443 Feb 15, 2022
dfeccdd
Added handle_block
JoseRodrigues443 Feb 15, 2022
3ab52b1
Update README.md
JoseRodrigues443 Feb 16, 2022
b61365b
Feat/merge with master (#3)
JoseRodrigues443 Mar 11, 2022
a064adb
Merge branch 'master' into master
JoseRodrigues443 Mar 11, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: build

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
directories: # Job that list subdirectories
runs-on: ubuntu-latest
outputs:
dir: ${{ steps.set-dirs.outputs.dir }} # generate output name dir by using inner step output
steps:
- uses: actions/checkout@v2
- id: set-dirs # Give it an id to handle to get step outputs in the outputs key above
run: echo "::set-output name=dir::$(ls -d */ | jq -R -s -c 'split("\n")[:-1]')"
# Define step output named dir base on ls command transformed to JSON thanks to jq
loop:
runs-on: ubuntu-latest
needs: [directories] # Depends on previous job
strategy:
matrix:
dir: ${{fromJson(needs.directories.outputs.dir)}} # List matrix strategy from directories dynamically
steps:
- uses: actions/checkout@v2
# only install and run tests if they exist on folder
- name: Build and run Jest tests
run: cd ${{matrix.dir}} && if ls ./src/*spec* &>/dev/null ; then npm i && npm run test; else echo "No Jest tests found. Skipping..." ; fi
# TODO: Make python tests work, for now they break because is not possible to mock Web3
- name: Build and run PyTest tests
run: cd ${{matrix.dir}} && if ls ./src/*test* &>/dev/null ; then echo "Tests without secret not supported yet, run locally -> npm i && npm run test"; else echo "No PyTest tests found. Skipping..." ; fi
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Forta Agent Examples

[![build](https://github.com/forta-protocol/forta-agent-examples/actions/workflows/build.yml/badge.svg)](https://github.com/forta-protocol/forta-agent-examples/actions/workflows/build.yml)

These examples demonstrate the possible use cases of Forta Agents with little to no configuration.

To run these examples, you'll need to:
Expand Down
3 changes: 1 addition & 2 deletions minimum-balance-py/src/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,5 @@ def handle_block(block_event):
w3 = get_web3_provider()
real_handle_block = provide_handle_block(w3)


def handle_block(block_event):
return real_handle_block(block_event)
return real_handle_block(block_event)