Skip to content

Check Adapters

Check Adapters #1649

name: Check Adapters
permissions:
contents: write
on:
push:
branches:
- master
schedule:
# Runs every 1 hours
- cron: "0 */1 * * *"
# Allows manual trigger from GitHub UI
workflow_dispatch:
jobs:
run-checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: false
fetch-depth: 0
- name: Reset and update submodule
run: |
git config --global user.name 'GitHub Action'
git config --global user.email '[email protected]'
# Remove submodule from index and working tree
git rm -f euler-interfaces || true
# Remove the submodule directory and .git/modules
rm -rf euler-interfaces
rm -rf .git/modules/euler-interfaces
# Remove the entry from .gitmodules and commit
rm -f .gitmodules
git commit -m "Remove old submodule" || true
# Create new .gitmodules file
echo '[submodule "euler-interfaces"]' > .gitmodules
echo ' path = euler-interfaces' >> .gitmodules
echo ' url = https://github.com/euler-xyz/euler-interfaces' >> .gitmodules
echo ' branch = master' >> .gitmodules
# Add and initialize the submodule
git submodule add -f -b master https://github.com/euler-xyz/euler-interfaces
# Commit the changes if any
git add .gitmodules euler-interfaces
git diff --quiet && git diff --staged --quiet || (git commit -m "Reset euler-interfaces submodule" && git push)
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
- name: Generate .env file
run: |
echo '${{ secrets.RPC_URLS }}' > .env
echo "EULER_DATA_API_URL=${{ secrets.EULER_DATA_API_URL }}" >> .env
- name: Install dependencies
run: npm ci
- name: Force latest oracle-sdk from main
run: |
npm remove @objectivelabs/oracle-sdk || true
npm install @objectivelabs/oracle-sdk@github:euler-xyz/oracle-sdk#main --prefer-online --no-audit --no-fund
- name: Run checks
run: npm run start
- name: Commit and push if changed
run: |
git config --global user.name 'GitHub Action'
git config --global user.email '[email protected]'
# Stage only the data directory
git add -f data/
# Only commit and push if there are changes
if ! git diff --cached --quiet; then
git commit -m "Update adapter check results"
git push origin HEAD:master
fi