Check Adapters #2276
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Check Adapters | |
| permissions: | |
| contents: write | |
| on: | |
| push: | |
| branches: | |
| - master | |
| schedule: | |
| # Runs every 1 hours | |
| - cron: "0 */1 * * *" | |
| 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]' | |
| git rm -f euler-interfaces || true | |
| rm -rf euler-interfaces | |
| rm -rf .git/modules/euler-interfaces | |
| rm -f .gitmodules | |
| git commit -m "Remove old submodule" || true | |
| echo '[submodule "euler-interfaces"]' > .gitmodules | |
| echo ' path = euler-interfaces' >> .gitmodules | |
| echo ' url = https://github.com/euler-xyz/euler-interfaces' >> .gitmodules | |
| echo ' branch = master' >> .gitmodules | |
| git submodule add -f -b master https://github.com/euler-xyz/euler-interfaces | |
| 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]' | |
| git add -f data/ | |
| if ! git diff --cached --quiet; then | |
| git commit -m "Update adapter check results" | |
| git push origin HEAD:master | |
| fi | |
| # 🆕 NEW STEP: Sync /data folder to AWS S3 | |
| - name: Sync data to S3 | |
| if: success() # only run if all previous steps passed | |
| uses: jakejarvis/[email protected] | |
| with: | |
| args: --follow-symlinks --delete | |
| env: | |
| AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }} | |
| AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| AWS_REGION: ${{ secrets.AWS_REGION }} | |
| SOURCE_DIR: data |