name: Rebaselining Integration Test

on:
  pull_request:
    branches:
      - main

jobs:
  rebaselining-integration-test:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v4

      - name: Set up Python 3.11
        uses: actions/setup-python@v4
        with:
          python-version: '3.11'

      - name: Install tox via Makefile
        run: |
          make setup

      - name: Configure AWS credentials for dev
        uses: aws-actions/configure-aws-credentials@v1
        with:
          aws-access-key-id: ${{ secrets.DEV_AWS_ACCESS_KEY_ID }}
          aws-secret-access-key: ${{ secrets.DEV_AWS_SECRET_ACCESS_KEY }}
          aws-region: eu-west-2

      - name: Run only rebaselining integration test
        env:
          EPC_AUTH_TOKEN: ${{ secrets.DEV_EPC_AUTH_TOKEN }}
        run: |
          make test ARGS="-m integration"
