name: Run Tests

on:
  push:
    branches:
      - 'main'
  pull_request:
    branches:
      - '**'
concurrency:
  group: ci-tests-${{ github.head_ref || github.ref }}-${{ github.repository }}
  cancel-in-progress: true
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout code
      uses: actions/checkout@v6
    - uses: actions/setup-go@v6
      with:
        go-version: '>=1.17.0'
    - name: Run tests
      run: |
        make tests
  test-e2e:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout code
      uses: actions/checkout@v6
    - uses: actions/setup-go@v6
      with:
        go-version: '>=1.17.0'
    - run: |
        make tests-e2e