From c210985324aee091600ad25b0a496b3b1e47a7fb Mon Sep 17 00:00:00 2001 From: alex Date: Tue, 13 May 2025 09:00:04 +0000 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20.github/workflows/all=5Ftest2.yaml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/all_test2.yaml | 101 +++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 .github/workflows/all_test2.yaml diff --git a/.github/workflows/all_test2.yaml b/.github/workflows/all_test2.yaml new file mode 100644 index 0000000..79dbae9 --- /dev/null +++ b/.github/workflows/all_test2.yaml @@ -0,0 +1,101 @@ +on: + workflow_call: + inputs: + tag: + description: 'Tag for registry' + type: string + default: latest + force_build: + type: boolean + description: force_build + default: false + +jobs: + tests: + runs-on: gpu + env: + effective_tag: ${{ inputs.tag || github.head_ref || github.ref_name }} + PR_NUMBER: ${{ github.event.pull_request.number }} + steps: + - name: Checkout + uses: actions/checkout@master + + - name: Login to Yandex Cloud + uses: yc-actions/yc-cr-login@v2 + with: + yc-sa-json-credentials: ${{ secrets.YC_SA_JSON_CREDENTIALS }} + + - name: Send PRBot feedback + uses: imgurbot12/prbot@v2 + with: + username: ${{ secrets.ACCOUNT_NAME }} + api_token: ${{ secrets.GITHUBTOKEN }} + + - name: Prepare prbot_data directory + run: mkdir -p /home/runner/prbot_data && chmod -R 777 /home/runner/prbot_data + + - name: Ruff format check (strict) + run: | + echo "Starting Ruff format check with tag: ${{ env.effective_tag }}" + + docker run --rm \ + -v /home/runner/prbot_data:/tmp \ + cr.yandex/crp8vh46gd976oq8ipla/${{ github.event.repository.name }}:${{ env.effective_tag }} \ + bash -c ' + pip install ruff + cd /server + echo "=== Ruff format check ===" + ruff format . --check + ' \ + | tee /home/runner/prbot_data/full_output.txt | prbot + + echo "=== Format Output ===" + cat /home/runner/prbot_data/full_output.txt + + - name: Run Docker with output redirection + run: | + docker run --rm \ + -v /home/runner/prbot_data:/tmp \ + cr.yandex/crp8vh46gd976oq8ipla/${{ github.event.repository.name }}:${{ env.effective_tag }} \ + bash -c ' + pip install ruff pytest pytest-github-actions-annotate-failures + echo "=== Ruff ===" + cd /server && ruff check . | sed "s|/server/||g" || true + ' \ + | tee /home/runner/prbot_data/full_output.txt | prbot + + echo "=== Full Output ===" + cat /home/runner/prbot_data/full_output.txt + + - name: Pytest individual files + PRBot formatting + run: | + docker run --rm \ + -v /home/runner/prbot_data:/tmp \ + cr.yandex/crp8vh46gd976oq8ipla/${{ github.event.repository.name }}:${{ env.effective_tag }} \ + bash -c ' + pip install pytest pytest-github-actions-annotate-failures + + cd /server + + echo "=== Running Pytest Files Individually ===" + + find . -name "test_*.py" | sort | while read -r test_file; do + echo "Starting Pytest for file: $test_file" + + pytest -v -W always "$test_file" --capture=no --annotate-failures 2>&1 | tee -a /tmp/test_output.txt + + echo "" >> /tmp/test_output.txt + done + + echo "=== Formatting Output for PRBot ===" + > /tmp/prbot_output.txt + ' \ + | tee /home/runner/prbot_data/full_output.txt | prbot + + echo " === Pytest raw output ===" + cat /home/runner/prbot_data/full_output.txt || echo "::warning::full_output.txt not found!" + + - name: Commit PRBot feedback + if: always() + run: | + prbot commit \ No newline at end of file