From db6236f7b04c3ea99fe83187b8d0b75105e6b774 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20M=C3=BCller?= Date: Wed, 30 Oct 2024 15:34:20 -0700 Subject: [PATCH] add a GitHub Action to get all contracts --- .../compatibility-check-template.yml | 1 + .github/workflows/get-contracts.yml | 52 +++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 .github/workflows/get-contracts.yml diff --git a/.github/workflows/compatibility-check-template.yml b/.github/workflows/compatibility-check-template.yml index 3a6b1c113..2f69e8804 100644 --- a/.github/workflows/compatibility-check-template.yml +++ b/.github/workflows/compatibility-check-template.yml @@ -108,6 +108,7 @@ jobs: path: | ./tmp/output-old.txt ./tmp/output-new.txt + ./tmp/contracts.csv # Check Diff diff --git a/.github/workflows/get-contracts.yml b/.github/workflows/get-contracts.yml new file mode 100644 index 000000000..93a1f4ffb --- /dev/null +++ b/.github/workflows/get-contracts.yml @@ -0,0 +1,52 @@ +name: Get contracts + +on: + workflow_call: + inputs: + chain: + required: true + type: string + secrets: + FLOWDIVER_API_KEY: + required: true + +env: + GO_VERSION: '1.22' + +concurrency: + group: ${{ github.workflow }}-${{ github.run_id }}-${{ inputs.chain }} + cancel-in-progress: true + +jobs: + check: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - uses: actions/setup-go@v4 + with: + go-version: ${{ env.GO_VERSION }} + cache: true + + - name: Make output dirs + run: | + mkdir tmp + + # Get contracts + + - name: Download contracts + env: + FLOWDIVER_API_KEY: ${{ secrets.FLOWDIVER_API_KEY }} + working-directory: ./tools/get-contracts + run: | + go run . --chain=${{ inputs.chain }} --apiKey="$FLOWDIVER_API_KEY" > ../../tmp/contracts.csv + + # Upload + + - name: Upload + uses: actions/upload-artifact@v3 + with: + name: ${{ inputs.chain }}-contracts + path: | + ./tmp/contracts.csv