name: Test
on:
  push:
    branches:
      - develop
      - main

jobs:
  test:
    runs-on: ubuntu-latest

    steps:
      - name: Check out repository code
        uses: actions/checkout@v2

      - name: Check Node.js version
        run: node --version

      - name: Install dependencies
        run: npm install
      - name: Run test suite
        run: |
          export JS_VSYS_HOST="${{ secrets.JS_VSYS_HOST }}"
          export JS_VSYS_SUPERNODE_ADDR="${{ secrets.JS_VSYS_SUPERNODE_ADDR }}"
          export JS_VSYS_SEED="${{ secrets.JS_VSYS_SEED }}"
          export JS_VSYS_AVG_BLOCK_DELAY="${{ secrets.JS_VSYS_AVG_BLOCK_DELAY }}"

          npm test
