Skip to content

Commit

Permalink
fix: fixed workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
mpsc0x committed Feb 28, 2025
1 parent 06b027c commit eb079a4
Show file tree
Hide file tree
Showing 11 changed files with 933 additions and 740 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: npm audit

on:
pull_request:
merge_group:
branches:
- fixes/evgeni/various
schedule:
- cron: '0 10 * * *'

jobs:
npm-scan:
name: ts-sdk npm audit
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
run_install: false

- name: Enable Corepack
run: corepack enable

- name: Get PNPM store directory
shell: bash
run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

- name: Setup PNPM cache
uses: actions/cache@v4
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install

- name: Run pnpm audit
run: pnpm audit
43 changes: 35 additions & 8 deletions .github/workflows/gen-deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,51 @@ name: Deploy documentation
on:
push:
branches:
- main
- fixes/evgeni/various
workflow_dispatch:

jobs:
deploy-typedoc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checkout repository
uses: actions/checkout@v4

- uses: actions/setup-node@v3
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 18

- name: Install PNPM
uses: pnpm/action-setup@v4
with:
version: 9
run_install: false

- name: Enable Corepack
run: corepack enable

- name: Get PNPM store directory
shell: bash
run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

- name: Setup PNPM cache
uses: actions/cache@v4
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: npm ci
run: pnpm install

- name: Generate documentation
run: npm run doc
- name: Install gh-pages globally
run: pnpm add -g gh-pages

- name: Deploy documentation
run: npm run deploy-docs
- name: Publish github pages
run: |
git remote set-url origin https://git:${GH_TOKEN}@github.com/aave/aave-v3-aptos-ts-sdk.git
npx gh-pages -d dist -u "github-actions-bot <[email protected]>"
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
51 changes: 39 additions & 12 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI

on:
push:
workflow_call:
workflow_dispatch:

jobs:
build:
Expand All @@ -14,16 +12,45 @@ jobs:
strategy:
matrix:
node-version: [16.x, 18.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- run: npm ci
- run: npm run build
- run: npm run fmt:check
- run: npm test

- name: Install PNPM
uses: pnpm/action-setup@v4
with:
version: 9
run_install: false

- name: Enable Corepack
run: corepack enable

- name: Get PNPM store directory
shell: bash
run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

- name: Setup PNPM cache
uses: actions/cache@v4
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install

- name: Build
run: pnpm run build

- name: Format Check
run: pnpm run fmt:check

- name: Run Tests
run: pnpm test
22 changes: 0 additions & 22 deletions .github/workflows/npm-publish-dev.yml

This file was deleted.

9 changes: 5 additions & 4 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ jobs:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checkout repository
uses: actions/checkout@v4

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 18
registry-url: https://registry.npmjs.org/
Expand All @@ -32,5 +33,5 @@ jobs:
- uses: softprops/action-gh-release@v1
with:
files: |
bundle.js
bundle.min.js
dist/bundle.js
dist/bundle.min.js
34 changes: 25 additions & 9 deletions .github/workflows/test-example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- main

jobs:
deploy-SC-example:
tes-api-example:
defaults:
run:
working-directory: ./examples/
Expand All @@ -15,25 +15,41 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install node
uses: actions/setup-node@v3
- name: Install PNPM
run: npm install -g pnpm

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: "18"
cache: "npm"
cache-dependency-path: ./package-lock.json

- name: Enable Corepack
run: corepack enable

- name: Get PNPM store directory
shell: bash
run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

- name: Setup PNPM cache
uses: actions/cache@v4
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: npm install
run: pnpm install --frozen-lockfile

- name: Build
run: npm run build
run: pnpm run build

- name: Deploy
run: |
echo ${{ secrets.JSON_RPC_URL_PUBLIC }}
if npm run test-borrow-example ; then
if pnpm run test-borrow-example ; then
echo "Borrow example passed!"
else
echo "Failed to run borrow example ..."
Expand Down
48 changes: 34 additions & 14 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,45 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
# https://github.com/actions/checkout/issues/298#issuecomment-664976337
ref: ${{ github.head_ref }}
# Checkout code using bot account
token: ${{ github.token }}

- name: Use Node.js
uses: actions/setup-node@v3
- name: Set Node.js
uses: actions/setup-node@v4
with:
node-version: 18.x
cache: 'npm'

- name: Install PNPM
uses: pnpm/action-setup@v4
with:
version: 9
run_install: false

- name: Enable Corepack
run: corepack enable

- name: Get PNPM store directory
shell: bash
run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

- name: Setup PNPM cache
uses: actions/cache@v4
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Execute unit tests
run: |
npm ci
npm run build
npm run fmt:check
npm run test
pnpm run build
pnpm run fmt:check
pnpm run test
- name: allow access to coverage.sh
run: chmod +x ./scripts/coverage.sh
Expand All @@ -42,12 +62,12 @@ jobs:
- name: Extract coverage
id: coverage
run: |
value=$(npm run test:cov | awk '/All files/ {print $10}' | tr -d '%')
value=$(pnpm run test:cov | awk '/All files/ {print $10}' | tr -d '%')
echo "coverage=$value" >> $GITHUB_OUTPUT
- name: Add test coverage to README
run: ./scripts/coverage.sh
shell: bash
run: ./scripts/coverage.sh
shell: bash
env:
COVERAGE: ${{ steps.coverage.outputs.coverage }}

Expand All @@ -62,4 +82,4 @@ jobs:
with:
commit_message: "Generate coverage badge"
file_pattern: "README.md"
commit_author: Aaave <[email protected]>
commit_author: Aave <[email protected]>
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Copyright (c) 2024 Aave. All Rights Reserved.
Copyright (c) 2025 Aave Labs. All Rights Reserved.
Loading

0 comments on commit eb079a4

Please sign in to comment.