Skip to content

feat/quotas

feat/quotas #24

Workflow file for this run

name: CI - API Tests
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
jobs:
build-and-test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
steps:
- name: Checkout API repo
uses: actions/checkout@v4
with:
path: totem-api
- name: Checkout contracts repo
uses: actions/checkout@v4
with:
repository: totembound/totem-contracts
path: totem-contracts
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: totem-api/package-lock.json
- name: Cache node modules
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('totem-api/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install Contracts dependencies
working-directory: ./totem-contracts
run: npm install
- name: Compile Contracts
working-directory: ./totem-contracts
run: npx hardhat compile
- name: Export Contract ABIs
working-directory: ./totem-contracts
run: npx hardhat export-abi --dest api
- name: Install API dependencies
working-directory: ./totem-api
run: npm install
- name: Run ESLint
working-directory: ./totem-api
continue-on-error: true
run: npm run lint
- name: Build
working-directory: ./totem-api
env:
CI: false # Prevents build from treating warnings as errors
run: npm run build
- name: Run tests
working-directory: ./totem-api
run: npm run test