name: Integration

on:
  push:
    branches:
      - main
      - staging
      - develop
      - alpha
  pull_request:
    types:
      - opened
      - reopened
      - synchronize
      - ready_for_review

jobs:
  tests:
    if: github.event.pull_request.draft == false
    runs-on: ubuntu-latest
    steps:
    - name: Install Go
      uses: actions/setup-go@v2
      with:
        go-version: 1.19.x
    - name: Checkout code
      uses: actions/checkout@v2
    - name: Install Solc
      uses: supplypike/setup-bin@v3
      with:
        uri: 'https://github.com/ethereum/solidity/releases/download/v0.8.16/solc-static-linux'
        name: 'solc'
        version: '0.8.16'
    - name: Install Geth Tools
      uses: gacts/install-geth-tools@v1
      with:
        version: 1.10.19
    - name: Build prerequisites
      run: |
        make dev_docker
        make -C bridge mock_abi
        make -C common/bytecode all
    - name: Run integration tests
      run: |
        go test -v -tags="mock_prover mock_verifier" -p 1 -coverprofile=coverage.txt scroll-tech/integration-test/...
