Skip to content

Merge pull request #134 from Xoulomon/feature/integration-tests #9

Merge pull request #134 from Xoulomon/feature/integration-tests

Merge pull request #134 from Xoulomon/feature/integration-tests #9

Workflow file for this run

name: Test Suite
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x]
steps:
- uses: actions/checkout@v3
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Run linter
run: pnpm lint
- name: Run type check
run: pnpm type-check
- name: Run unit tests
run: pnpm test:ci
- name: Run integration tests
run: pnpm test:integration
env:
NODE_ENV: test
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: ./coverage/lcov.info
flags: unittests
name: codecov-umbrella
- name: Generate coverage badge
if: matrix.node-version == '20.x'
run: |
COVERAGE=$(cat coverage/coverage-summary.json | jq '.total.lines.pct')
echo "Coverage: $COVERAGE%"
blockchain-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Run Rust tests
run: pnpm blockchain:test