From 7450df5e12a8143e29837e30bdf9fea94aa0cfb5 Mon Sep 17 00:00:00 2001 From: Tanmay Kumar Chaki Date: Fri, 22 Aug 2025 14:59:06 +0530 Subject: [PATCH 1/6] Update build.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Improved reliability: Updated action versions (checkout@v5 → @v4, setup-uv@v6 → @v3) and pinned Python to "3.11" for consistent builds across environments -Enhanced caching strategy: Extended dependency caching to include both uv.lock and pyproject.toml files, reducing CI run times for the team Added code quality gates: -Integrated ruff linting to maintain code standards -Added pytest execution to catch regressions early -Implemented automatic package building for release readiness -Better developer experience: Added descriptive step names and structured workflow for easier debugging and maintenance -Streamlined configuration: Removed unnecessary allow-prereleases flag to prevent potential instability issues --- .github/workflows/build.yml | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 69192db0c4c6..d5181581cc20 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,18 +7,36 @@ on: jobs: build: + name: Build and Test runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 + - name: Checkout Repository + - uses: actions/checkout@v4 + - uses: astral-sh/setup-uv@v6 + - name: Set up uv + - uses: astral-sh/setup-uv@v3 with: enable-cache: true - cache-dependency-glob: uv.lock + cache-dependency-glob: | + **/uv.lock + **/pyproject.toml + - name: Set up Python - uses: actions/setup-python@v5 with: - python-version: 3.x + python-version: 3.11 allow-prereleases: true - - run: uv sync --group=test + + - name: Install dependencies + - run: | + uv sync --all-extras + uv pip list + + - name: Lint code + run: uv run ruff check , --output-format=github + + - name: Run tests # TODO: #8818 Re-enable quantum tests run: uv run pytest @@ -34,5 +52,10 @@ jobs: --ignore=web_programming/fetch_anime_and_play.py --cov-report=term-missing:skip-covered --cov=. . + + - name: Build package (if needed) + run: uv build + - if: ${{ success() }} run: scripts/build_directory_md.py 2>&1 | tee DIRECTORY.md + From 1bcbab12b9e344c523434e3f402c07b0cec4209e Mon Sep 17 00:00:00 2001 From: Tanmay Kumar Chaki Date: Fri, 22 Aug 2025 20:22:29 +0530 Subject: [PATCH 2/6] Update build.yml --- .github/workflows/build.yml | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d5181581cc20..0dac4f953819 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,10 +1,8 @@ name: "build" - on: pull_request: schedule: - cron: "0 0 * * *" # Run everyday - jobs: build: name: Build and Test @@ -13,7 +11,6 @@ jobs: - uses: actions/checkout@v5 - name: Checkout Repository - uses: actions/checkout@v4 - - uses: astral-sh/setup-uv@v6 - name: Set up uv - uses: astral-sh/setup-uv@v3 @@ -27,16 +24,12 @@ jobs: with: python-version: 3.11 allow-prereleases: true - - name: Install dependencies - run: | uv sync --all-extras uv pip list - - name: Lint code - run: uv run ruff check , --output-format=github - - + run: uv run ruff check , --output-format=github - name: Run tests # TODO: #8818 Re-enable quantum tests run: uv run pytest @@ -52,10 +45,8 @@ jobs: --ignore=web_programming/fetch_anime_and_play.py --cov-report=term-missing:skip-covered --cov=. . - - name: Build package (if needed) run: uv build - - if: ${{ success() }} run: scripts/build_directory_md.py 2>&1 | tee DIRECTORY.md From 3ae98dfbad107abb98e0b2284d9955793bfaabbb Mon Sep 17 00:00:00 2001 From: Tanmay Kumar Chaki Date: Fri, 22 Aug 2025 20:55:22 +0530 Subject: [PATCH 3/6] Update build.yml --- .github/workflows/build.yml | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0dac4f953819..567bd36dc9f7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,8 +1,26 @@ -name: "build" +name: "Build CI/CD PipeLine" + on: - pull_request: - schedule: - - cron: "0 0 * * *" # Run everyday + push: + branches: [main, develop] + paths-ignore: + - "*.md" + - "docs/**" + + + pull_request: + branches: [main] + types: [opened, synchronize, reopened] + paths-ignore: + - "*.md" + - "docs/**" + schedule: + - cron: "0 0 * * *" + + workflow_dispatch: + + + jobs: build: name: Build and Test From 10e58eb7edd89bf7e5df9ed00810c624d0c62f7d Mon Sep 17 00:00:00 2001 From: Tanmay Kumar Chaki Date: Sat, 23 Aug 2025 11:13:39 +0530 Subject: [PATCH 4/6] Update build.yml --- .github/workflows/build.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 567bd36dc9f7..0e5f72d83793 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,10 +26,9 @@ jobs: name: Build and Test runs-on: ubuntu-latest steps: - - uses: actions/checkout@v5 - name: Checkout Repository - - uses: actions/checkout@v4 - - uses: astral-sh/setup-uv@v6 + - uses: actions/checkout@v5 + - name: Set up uv - uses: astral-sh/setup-uv@v3 with: @@ -47,7 +46,7 @@ jobs: uv sync --all-extras uv pip list - name: Lint code - run: uv run ruff check , --output-format=github + run: uv run ruff check . --output-format=github - name: Run tests # TODO: #8818 Re-enable quantum tests run: uv run pytest From ff8f54c9b8f4bf8bc727c3336f00ec65a5dc7026 Mon Sep 17 00:00:00 2001 From: Tanmay Kumar Chaki Date: Sat, 23 Aug 2025 11:28:00 +0530 Subject: [PATCH 5/6] Update build.yml --- .github/workflows/build.yml | 39 +++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0e5f72d83793..e60ce9c88de2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,8 +6,7 @@ on: paths-ignore: - "*.md" - "docs/**" - - + pull_request: branches: [main] types: [opened, synchronize, reopened] @@ -19,8 +18,6 @@ on: workflow_dispatch: - - jobs: build: name: Build and Test @@ -49,21 +46,25 @@ jobs: run: uv run ruff check . --output-format=github - name: Run tests # TODO: #8818 Re-enable quantum tests - run: uv run pytest - --ignore=computer_vision/cnn_classification.py - --ignore=docs/conf.py - --ignore=dynamic_programming/k_means_clustering_tensorflow.py - --ignore=machine_learning/lstm/lstm_prediction.py - --ignore=neural_network/input_data.py - --ignore=project_euler/ - --ignore=quantum/q_fourier_transform.py - --ignore=scripts/validate_solutions.py - --ignore=web_programming/current_stock_price.py - --ignore=web_programming/fetch_anime_and_play.py - --cov-report=term-missing:skip-covered - --cov=. . + run: | + uv run pytest \ + --ignore=computer_vision/cnn_classification.py \ + --ignore=docs/conf.py \ + --ignore=dynamic_programming/k_means_clustering_tensorflow.py \ + --ignore=machine_learning/lstm/lstm_prediction.py \ + --ignore=neural_network/input_data.py \ + --ignore=project_euler/ \ + --ignore=quantum/q_fourier_transform.py \ + --ignore=scripts/validate_solutions.py \ + --ignore=web_programming/current_stock_price.py \ + --ignore=web_programming/fetch_anime_and_play.py \ + --cov-report=term-missing:skip-covered \ + --cov=. . + - name: Build package (if needed) run: uv build - - if: ${{ success() }} - run: scripts/build_directory_md.py 2>&1 | tee DIRECTORY.md + if: ${{ success() }} + + - name: Generate Directory Markdoun + run: python scripts/build_directory_md.py 2>&1 | tee DIRECTORY.md From 263ddaa59de9d336ef7d6098f240a5b4a65d5fa3 Mon Sep 17 00:00:00 2001 From: Tanmay Kumar Chaki Date: Sat, 23 Aug 2025 11:42:56 +0530 Subject: [PATCH 6/6] Update build.yml --- .github/workflows/build.yml | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e60ce9c88de2..a8819af6c436 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,11 +1,11 @@ -name: "Build CI/CD PipeLine" +name: "Build CI/CD Pipeline" on: push: branches: [main, develop] paths-ignore: - - "*.md" - - "docs/**" + - "*.md" + - "docs/**" pull_request: branches: [main] @@ -14,7 +14,7 @@ on: - "*.md" - "docs/**" schedule: - - cron: "0 0 * * *" + - cron: "0 0 * * *" workflow_dispatch: @@ -24,22 +24,22 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Repository - - uses: actions/checkout@v5 + uses: actions/checkout@v5 - name: Set up uv - - uses: astral-sh/setup-uv@v3 + uses: astral-sh/setup-uv@v3 with: enable-cache: true cache-dependency-glob: | - **/uv.lock - **/pyproject.toml + **/uv.lock + **/pyproject.toml - name: Set up Python - - uses: actions/setup-python@v5 + uses: actions/setup-python@v5 with: - python-version: 3.11 + python-version: "3.11" allow-prereleases: true - name: Install dependencies - - run: | + run: | uv sync --all-extras uv pip list - name: Lint code @@ -60,11 +60,12 @@ jobs: --ignore=web_programming/fetch_anime_and_play.py \ --cov-report=term-missing:skip-covered \ --cov=. . - + - name: Build package (if needed) - run: uv build - if: ${{ success() }} + run: uv build + if: ${{ success() }} - - name: Generate Directory Markdoun + - name: Generate Directory Markdown run: python scripts/build_directory_md.py 2>&1 | tee DIRECTORY.md + if: ${{ success() }}