From e228e883d033361c96794f658f3407ed89ceb0ff Mon Sep 17 00:00:00 2001 From: ptiurin Date: Wed, 17 Sep 2025 16:49:15 +0100 Subject: [PATCH] ci(NoTicket): Use shared core action --- .github/resources/core/config.json | 7 --- .github/resources/core/docker-compose.yml | 16 ------ .github/workflows/integration-tests-core.yml | 55 ++++---------------- 3 files changed, 9 insertions(+), 69 deletions(-) delete mode 100644 .github/resources/core/config.json delete mode 100644 .github/resources/core/docker-compose.yml diff --git a/.github/resources/core/config.json b/.github/resources/core/config.json deleted file mode 100644 index 4697c3a..0000000 --- a/.github/resources/core/config.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "nodes": [ - { - "host": "firebolt-core" - } - ] -} diff --git a/.github/resources/core/docker-compose.yml b/.github/resources/core/docker-compose.yml deleted file mode 100644 index 723adab..0000000 --- a/.github/resources/core/docker-compose.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: firebolt-core - -services: - firebolt-core: - image: ghcr.io/firebolt-db/firebolt-core:${IMAGE_TAG} - container_name: firebolt-core - command: --node 0 - privileged: true - restart: no - ulimits: - memlock: 8589934592 - ports: - - 3473:3473 - volumes: - - ${BASE_DIR}/.github/resources/core/config.json:/firebolt-core/config.json:ro - - ${BASE_DIR}/firebolt-core:/firebolt-core/data diff --git a/.github/workflows/integration-tests-core.yml b/.github/workflows/integration-tests-core.yml index 0e15c1b..ff8f8f4 100644 --- a/.github/workflows/integration-tests-core.yml +++ b/.github/workflows/integration-tests-core.yml @@ -12,7 +12,7 @@ on: description: 'Python version' required: false type: string - default: '3.8' + default: '3.9' workflow_call: inputs: tag_version: @@ -24,21 +24,21 @@ on: description: 'Python version' required: false type: string - default: '3.8' + default: '3.9' jobs: run-core-integration-tests: runs-on: ubuntu-latest - env: - DOCKER_COMPOSE_FILE: ${{ github.workspace }}/.github/resources/core/docker-compose.yml - SERVICE_PORT: 3473 - SERVICE_URL: http://localhost:3473 - MAX_RETRIES: 30 - RETRY_INTERVAL: 2 steps: - name: Check out code uses: actions/checkout@v4 + - name: Setup Firebolt Core + id: setup-core + uses: firebolt-db/action-setup-core@main + with: + tag_version: ${{ inputs.tag_version || vars.DEFAULT_CORE_IMAGE_TAG }} + - name: Set up Python uses: actions/setup-python@v5 with: @@ -48,49 +48,12 @@ jobs: run: | python -m pip install --upgrade pip pip install ".[dev]" - - - name: Log in to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Prepare docker-compose.yml - run: | - sed -i "s|\${IMAGE_TAG}|${{ inputs.tag_version }}|g" "$DOCKER_COMPOSE_FILE" - sed -i "s|\${BASE_DIR}|${{ github.workspace }}|g" "$DOCKER_COMPOSE_FILE" - - - name: Start service container - run: | - docker compose -f "$DOCKER_COMPOSE_FILE" up -d - docker compose -f "$DOCKER_COMPOSE_FILE" ps - - - name: Wait for service to be ready - run: | - for i in $(seq 1 $MAX_RETRIES); do - if curl --silent --fail "$SERVICE_URL" --data-binary "SELECT 1" | grep -q "1"; then - echo "Service is up and responding!" - exit 0 - fi - echo "Waiting for service... ($i/$MAX_RETRIES)" - sleep $RETRY_INTERVAL - done - echo "Error: Service failed to start within timeout" - docker compose -f "$DOCKER_COMPOSE_FILE" logs - exit 1 - - name: Run Core integration tests env: - CORE_URL: "http://localhost:3473" + CORE_URL: ${{ steps.setup-core.outputs.service_url }} run: | pytest -o log_cli=true -o log_cli_level=INFO tests/integration -k "core" --alluredir=allure-results - - name: Stop container - if: always() - run: | - docker compose -f "$DOCKER_COMPOSE_FILE" down - # Need to pull the pages branch in order to fetch the previous runs - name: Get Allure history uses: actions/checkout@v4