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 a89a3c4
Show file tree
Hide file tree
Showing 7 changed files with 287 additions and 278 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/gen-deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Deploy documentation
on:
push:
branches:
- main
- fixes/evgeni/various
workflow_dispatch:

jobs:
Expand All @@ -15,12 +15,16 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 18
cache: "pnpm"

- name: Install PNPM
run: pnpm install -g pnpm

- name: Install dependencies
run: npm ci
run: pnpm install --frozen-lockfile

- name: Generate documentation
run: npm run doc
run: pnpm run doc

- name: Deploy documentation
run: npm run deploy-docs
run: pnpm run deploy-docs
50 changes: 38 additions & 12 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# 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:
Expand All @@ -14,16 +11,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@v3
with:
version: 8
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: 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.

15 changes: 9 additions & 6 deletions .github/workflows/test-example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,26 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3

- name: Install node
- name: Install PNPM
run: npm install -g pnpm

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

- 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
24 changes: 15 additions & 9 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,24 @@ jobs:
# Checkout code using bot account
token: ${{ github.token }}

- name: Install PNPM
run: npm install -g pnpm

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: 'npm'
cache: "pnpm"
cache-dependency-path: ./pnpm-lock.yaml

- 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 +48,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 +68,4 @@ jobs:
with:
commit_message: "Generate coverage badge"
file_pattern: "README.md"
commit_author: Aaave <[email protected]>
commit_author: Aave <[email protected]>
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,14 @@
"devDependencies": {
"@types/bn.js": "^5.1.6",
"@types/jest": "^29.5.14",
"@types/node": "^22.13.2",
"@typescript-eslint/eslint-plugin": "^8.24.0",
"@typescript-eslint/parser": "^8.24.0",
"@types/node": "^22.13.5",
"@typescript-eslint/eslint-plugin": "^8.25.0",
"@typescript-eslint/parser": "^8.25.0",
"chalk": "^5.4.1",
"eslint": "^9.20.1",
"eslint": "^9.21.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-airbnb-typescript": "^18.0.0",
"eslint-config-prettier": "^10.0.1",
"eslint-config-prettier": "^10.0.2",
"eslint-config-standard": "^17.1.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-jsdoc": "^50.6.3",
Expand All @@ -107,15 +107,15 @@
"node-ts": "^8.0.0",
"npm-run-all": "^4.1.5",
"ora": "^8.2.0",
"prettier": "^3.5.0",
"prettier": "^3.5.2",
"prettier-eslint": "^16.3.0",
"prettier-standard": "^16.4.1",
"rimraf": "^6.0.1",
"ts-jest": "^29.2.5",
"ts-jest": "^29.2.6",
"ts-loader": "^9.5.2",
"typedoc": "^0.27.7",
"typedoc": "^0.27.9",
"typescript": "^5.7.3",
"typescript-eslint": "^8.24.0",
"typescript-eslint": "^8.25.0",
"webpack": "^5.97.1",
"webpack-cli": "^6.0.1"
},
Expand Down
Loading

0 comments on commit a89a3c4

Please sign in to comment.