Fix escaping of terms for markdown #5185
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: E2E Tests | |
on: | |
pull_request: | |
branches-ignore: | |
- 'weblate-**' | |
workflow_dispatch: | |
inputs: | |
distinct_id: | |
description: 'for the return-dispatch action' | |
required: false | |
control-api: | |
description: 'custom control-api version' | |
data-api: | |
description: 'custom data-api version' | |
us: | |
description: 'custom us version' | |
ui: | |
description: 'custom ui version' | |
default: 'release' | |
env: | |
CONTROL_API_VERSION: ${{github.event.inputs.control-api}} | |
DATA_API_VERSION: ${{github.event.inputs.data-api}} | |
US_VERSION: ${{github.event.inputs.us}} | |
UI_VERSION: ${{github.event.inputs.ui}} | |
concurrency: | |
group: ${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
run-e2e: | |
name: Install Datalens and Run E2E Tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: echo distinct ID ${{ github.event.inputs.distinct_id }} | |
run: echo ${{ github.event.inputs.distinct_id }} | |
- uses: actions/checkout@v4 | |
- uses: docker/setup-buildx-action@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
cache: 'npm' | |
cache-dependency-path: ./package-lock.json | |
- name: Get last version config | |
run: | | |
VERSION_CONFIG=$(curl -s https://api.github.com/repos/datalens-tech/datalens/contents/versions-config.json | jq -r '.content' | base64 -d) | |
if [ "${{ env.UI_VERSION }}" == "release" ]; then | |
UI_VERSION=$(echo "${VERSION_CONFIG}" | jq -r '.uiVersion') | |
echo "UI_VERSION=$UI_VERSION" >> "$GITHUB_ENV" | |
fi | |
if [ -z "${{ env.US_VERSION }}" ]; then | |
US_VERSION=$(echo "${VERSION_CONFIG}" | jq -r '.usVersion') | |
echo "US_VERSION=$US_VERSION" >> "$GITHUB_ENV" | |
fi | |
if [ -z "${{ env.CONTROL_API_VERSION }}" ]; then | |
CONTROL_API_VERSION=$(echo "${VERSION_CONFIG}" | jq -r '.controlApiVersion') | |
echo "CONTROL_API_VERSION=$CONTROL_API_VERSION" >> "$GITHUB_ENV" | |
fi | |
if [ -z "${{ env.DATA_API_VERSION }}" ]; then | |
DATA_API_VERSION=$(echo "${VERSION_CONFIG}" | jq -r '.dataApiVersion') | |
echo "DATA_API_VERSION=$DATA_API_VERSION" >> "$GITHUB_ENV" | |
fi | |
env: | |
US_VERSION: ${{ env.US_VERSION }} | |
CONTROL_API_VERSION: ${{ env.CONTROL_API_VERSION }} | |
DATA_API_VERSION: ${{ env.DATA_API_VERSION }} | |
UI_VERSION: ${{ env.UI_VERSION }} | |
- name: Check docker compose Config | |
run: npm run test:e2e:docker:check | |
env: | |
US_VERSION: ${{ env.US_VERSION }} | |
CONTROL_API_VERSION: ${{ env.CONTROL_API_VERSION }} | |
DATA_API_VERSION: ${{ env.DATA_API_VERSION }} | |
UI_VERSION: ${{ env.UI_VERSION }} | |
- name: Build docker ui image with cache | |
if: ${{ env.UI_VERSION == '' }} | |
uses: docker/[email protected] | |
with: | |
network: host | |
context: . | |
push: false | |
load: true | |
tags: e2e-datalens-ui:pr | |
platforms: linux/amd64 | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
- name: Up docker compose and install local deps for test | |
if: ${{ env.UI_VERSION == '' }} | |
run: | | |
sudo rm /etc/apt/sources.list.d/microsoft-prod.list | |
npm run test:e2e:docker:up-no-build && npm ci && npm run test:install:chromium & wait | |
env: | |
US_VERSION: ${{ env.US_VERSION }} | |
CONTROL_API_VERSION: ${{ env.CONTROL_API_VERSION }} | |
DATA_API_VERSION: ${{ env.DATA_API_VERSION }} | |
- name: Run tests local from repo | |
if: ${{ env.UI_VERSION == '' }} | |
run: npm run test:e2e:opensource | |
env: | |
NO_AUTH: true | |
E2E_RETRY_TIMES: 1 | |
E2E_TEST_TIMEOUT: 90000 | |
E2E_ACTION_TIMEOUT: 10000 | |
E2E_EXPECT_TIMEOUT: 10000 | |
E2E_DOMAIN: http://localhost:8080 | |
- name: Run tests from builded docker image | |
if: ${{ env.UI_VERSION != '' }} | |
run: | | |
npm run test:e2e:docker | |
env: | |
US_VERSION: ${{ env.US_VERSION }} | |
CONTROL_API_VERSION: ${{ env.CONTROL_API_VERSION }} | |
DATA_API_VERSION: ${{ env.DATA_API_VERSION }} | |
UI_VERSION: ${{ env.UI_VERSION }} | |
E2E_RETRY_TIMES: 1 | |
E2E_TEST_TIMEOUT: 90000 | |
E2E_ACTION_TIMEOUT: 10000 | |
E2E_EXPECT_TIMEOUT: 10000 | |
- name: Copy tests report from docker run | |
if: always() | |
run: | | |
if [ -z "${{ env.UI_VERSION }}" ]; then | |
echo "skip export report from docker run..." | |
else | |
echo "export report from docker run" | |
rm -rf ./tests/artifacts | |
npm run test:e2e:docker:report | |
fi | |
env: | |
US_VERSION: ${{ env.US_VERSION }} | |
CONTROL_API_VERSION: ${{ env.CONTROL_API_VERSION }} | |
DATA_API_VERSION: ${{ env.DATA_API_VERSION }} | |
UI_VERSION: ${{ env.UI_VERSION }} | |
- name: Run docker compose down | |
if: always() | |
run: | | |
npm run test:e2e:docker:down | |
env: | |
US_VERSION: ${{ env.US_VERSION }} | |
CONTROL_API_VERSION: ${{ env.CONTROL_API_VERSION }} | |
DATA_API_VERSION: ${{ env.DATA_API_VERSION }} | |
UI_VERSION: ${{ env.UI_VERSION }} | |
- name: Save report link and pr number | |
if: always() | |
run: | | |
mkdir -p ./tests/artifacts | |
echo "reports/${{ github.head_ref || github.ref_name }}/${{ github.run_id }}/${{ github.run_attempt }}" > ./tests/artifacts/report-link | |
echo "${{ github.event.pull_request.number }}" > ./tests/artifacts/report-pr | |
- uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: playwright-report | |
path: ./tests/artifacts/ | |
retention-days: 30 |