From e17c62bac937ae50fe0f64e96b96dbf2069f2e30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Mazzucotelli?= Date: Sun, 13 Oct 2024 00:05:48 +0200 Subject: [PATCH] ci: Don't wait for generated project's CI It's already tested by the upstream template. --- .github/workflows/ci.yml | 33 --------------------------------- tests/wait_ci.sh | 40 ---------------------------------------- 2 files changed, 73 deletions(-) delete mode 100644 tests/wait_ci.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 31c5a41..928d243 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -93,36 +93,3 @@ jobs: - name: Test project generation and workflow run: bash tests/test_project.sh - - test-project-ci: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Configure Git - run: | - git config --global init.defaultBranch main - git config --global user.email "dev@pawamoy.fr" - git config --global user.name "Timothée Mazzucotelli" - - - name: Setup Python - uses: actions/setup-python@v5 - with: - python-version: "3.12" - - - name: Setup uv - uses: astral-sh/setup-uv@v3 - with: - enable-cache: true - cache-dependency-glob: project/pyproject.toml.jinja - - - name: Install Copier - run: uv tool install copier --with copier-templates-extensions - - - name: Trigger and wait project's own CI - env: - GH_TOKEN: ${{ secrets.TESTING_PUSH_TOKEN }} - run: bash tests/wait_ci.sh diff --git a/tests/wait_ci.sh b/tests/wait_ci.sh deleted file mode 100644 index 328f9ce..0000000 --- a/tests/wait_ci.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env bash -echo "Fetching previous run number..." -previous_run=$(gh run list --repo pawamoy/pawamoy-testing --branch 0.1.0 --limit 1 --workflow "ci.yml" --json number --jq ".[0].number") - -echo "Resetting project's Git history..." -rm -rf tests/tmp/* -make reset-history -cd tests/tmp || exit 1 - -wait_time=20 -echo "Waiting project's workflow completion (${wait_time}s iterations)..." -while true; do - if output=$(gh run list --repo pawamoy/pawamoy-testing --branch 0.1.0 --limit 1 --workflow "ci.yml" --json number,status,conclusion); then - number=$(jq -r ".[0].number" <<< "$output") - if [ "${number}" -gt "${previous_run}" ]; then - status=$(jq -r ".[0].status" <<< "$output") - if [ "${status}" = "completed" ]; then - conclusion=$(jq -r ".[0].conclusion" <<< "$output") - echo "Workflow completed: ${conclusion}" - if [ "${conclusion}" = "success" ]; then - break - else - exit 1 - fi - else - echo "Workflow status: ${status}" - fi - else - echo "Workflow not created" - fi - else - echo "Workflow not created" - fi - sleep ${wait_time} -done - -echo "Deleting all testing releases..." -for tag in $(gh release list --repo pawamoy/pawamoy-testing --json tagName --jq ".[].tagName"); do - gh release delete "${tag}" --repo pawamoy/pawamoy-testing --yes --cleanup-tag || true -done \ No newline at end of file