name: Acceptance Tests using docker compose

on:
  push:
    branches:
      - '3.x'
  pull_request:
    branches:
      - '**'

env:
  CI: true
  # Force terminal colors. @see https://www.npmjs.com/package/colors
  FORCE_COLOR: 1

jobs:
  build:
    runs-on: ubuntu-latest

    strategy:
      matrix:
        node-version: [20.x]

    steps:
      # Checkout the repository
      - name: Checkout Repository
        uses: actions/checkout@v4

      # Install Docker Compose
      - name: Install Docker Compose
        run: |
          sudo apt-get update
          sudo apt-get install -y docker-compose

      # Run rest tests using docker-compose
      - name: Run REST Tests
        run: docker-compose run --rm test-rest
        working-directory: test

      # Run WebDriverIO acceptance tests using docker-compose
      - name: Run WebDriverIO Acceptance Tests
        run: docker-compose run --rm test-acceptance.webdriverio
        working-directory: test

      # Run faker BDD tests using docker-compose
      - name: Run Faker BDD Tests
        run: docker-compose run --rm test-bdd.faker
        working-directory: test
