diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index afb14e960..253a10539 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -168,3 +168,83 @@ jobs: pip install predeployed/dist/ima_predeployed-*.whl python predeployed/scripts/generate_abi.py > data/ima-$VERSION-predeployed-abi.json +test-integration: + runs-on: ubuntu-latest + + env: + working-directory: ./test + + steps: + - uses: actions/checkout@v2 + + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + + - uses: actions/cache@v2 + id: yarn-cache + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + + - uses: actions/cache@v2 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + + - name: Set up Node + uses: actions/setup-node@v2 + with: + node-version: '16' + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.8 + + - name: Get IMA contracts + run: | + git clone https://github.com/skalenetwork/IMA.git --recursive-submodules + cd IMA + yarn install + cd .. + + - name: Compile contracts + working-directory: ./proxy + run: | + yarn install + + - name: Install all NPMs + run: | + yarn install + + - name: Start background ganache + working-directory: ./proxy + run: | + npx ganache --miner.blockGasLimit 12000000 --logging.quiet --chain.allowUnlimitedContractSize --wallet.defaultBalance 2000000 --wallet.accountKeysPath ../test/accounts.json & + + - name: Prepare test (PY part) + working-directory: ${{env.working-directory}} + run: | + python3 ../scripts/config_from_accounts.py accounts.json config.json + pip3 install -r requirements.txt + + - name: Run test (PY part) + working-directory: ${{env.working-directory}} + run: | + python3 test.py + + - name: Prepare test (JS part) + working-directory: ${{env.working-directory}} + run: | + yarn install + + - name: Run test (JS part) + working-directory: ${{env.working-directory}} + run: | + yarn test +