Skip to content

Commit

Permalink
update github action
Browse files Browse the repository at this point in the history
  • Loading branch information
g1nt0ki committed Apr 20, 2022
1 parent ec541cb commit fde9fc5
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 16 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/getFileList.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const MODIFIED = parse(process.env.MODIFIED)
const ADDED = parse(process.env.ADDED)
const fileSet = new Set();

[...MODIFIED, ...ADDED].forEach(file => {
const [root, dir] = file.split('/')
if (root === 'projects' && dir !=='helper') fileSet.add(root + '/' + dir)
})

console.log(JSON.stringify([...fileSet]))

function parse(data) {
return data.replace('[', '').replace(']', '').split(',')
}
29 changes: 14 additions & 15 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,20 @@ jobs:
uses: actions/checkout@v2
- name: Run changes files through test script
run: |
npm install
for i in $(echo ${{ steps.file_changes.outputs.files_modified}} | tr -d '[]' | tr "," "\n")
do
{
node ${{ github.workspace }}/test.js ${{ github.workspace }}/${i} 2>&1 | tee output.txt
node ${{ github.workspace }}/.github/workflows/commentResult.js /home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/output.txt "${{ github.repository_owner }}" "${{ github.event.repository.name }}" "${{ github.event.number }}" ${i}
if grep -q "\-\-\-\- ERROR \-\-\-\-" output.txt; then
exit 1;
fi
} || {
echo -n $i
echo ' doesnt run'
}
done
for i in $(echo ${{ steps.file_changes.outputs.files_added}} | tr -d '[]' | tr "," "\n")
RUN_FILES=$(
MODIFIED=${{ steps.file_changes.outputs.files_modified}} \
ADDED=${{ steps.file_changes.outputs.files_modified}} \
node ${{ github.workspace }}/.github/workflows/getFileList.js
)
if [ "$RUN_FILES" = "[]" ]; then
echo "No adapter files were modified"
exit 0
fi
npm ci
for i in $(echo $RUN_FILES | tr -d '"[]' | tr "," "\n")
do
{
node ${{ github.workspace }}/test.js ${{ github.workspace }}/${i} 2>&1 | tee output.txt
Expand Down
2 changes: 1 addition & 1 deletion projects/0vix/abi.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"0vix_getAllMarkets": {"inputs":[],"name":"getAllMarkets","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},
"market_underlying": {"inputs":[],"name":"underlying","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},
"market_totalBorrows": {"inputs":[],"name":"totalBorrows","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}
"market_totalBorrows": {"inputs":[],"name":"totalBorrows","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}
}

0 comments on commit fde9fc5

Please sign in to comment.