Skip to content

Commit

Permalink
add CI
Browse files Browse the repository at this point in the history
  • Loading branch information
fleupold committed Aug 19, 2024
1 parent b0425a9 commit 270206d
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
28 changes: 28 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Sync to Dune
on:
push:
branches: [main]

jobs:
update-queries:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Necessary to get a complete history for diff

- name: Get list of changed files in a specific directory
id: get-changed-files
run: |
CHANGED_FILES=$(git diff \
--name-only ${{ github.event.before }} ${{ github.sha }} \
-- queries | paste -sd "," -)
echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV
echo "changed_files=$CHANGED_FILES" >> $GITHUB_OUTPUT
- name: Update Queries
uses: bh2smith/[email protected]
with:
changedQueries: ${{ steps.get-changed-files.outputs.changed_files }}
duneApiKey: ${{ secrets.DUNE_API_KEY }}
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# dune-queries
# Dune Queries

Repository containing protocol relevant dune queries

All query file names must be formatted as `*_{queryId}.sql`. This will continuous integration to automatically sync queries whenever a PR is merged into main.
3 changes: 3 additions & 0 deletions test_3999763.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SELECT *
FROM ethereum.transactions
LIMIT 2

0 comments on commit 270206d

Please sign in to comment.