name: geth unit tests


on:
  push:
    paths:
      - 'l2geth/**'
    branches:
      - 'master'
      - 'develop'
      - '*rc'
      - 'regenesis/*'
  pull_request:
    paths:
      - 'l2geth/**'
    branches:
      - 'master'
      - 'develop'
      - '*rc'
      - 'regenesis/*'
  workflow_dispatch:

defaults:
  run:
    working-directory: ./l2geth

jobs:
  lint:
    runs-on: ubuntu-latest

    steps:
    - name: Install Go
      uses: actions/setup-go@v2
      with:
        go-version: 1.15.x

    - name: Checkout code
      uses: actions/checkout@v2

    - name: Lint
      run: make lint

  tests:
    runs-on: ubuntu-latest

    steps:
    - name: Install Go
      uses: actions/setup-go@v2
      with:
        go-version: 1.15.x

    - name: Checkout code
      uses: actions/checkout@v2

    - name: Install
      run: make

    - name: Test
      run: make test
