[llvm] [CI][Github] Add Workflow to Run Python Tests in CI Folder (PR #148696)
Aiden Grossman via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 14 12:48:29 PDT 2025
https://github.com/boomanaiden154 updated https://github.com/llvm/llvm-project/pull/148696
>From bda217315776bf63f9b32a99c41650582ec7e74c Mon Sep 17 00:00:00 2001
From: Aiden Grossman <aidengrossman at google.com>
Date: Mon, 14 Jul 2025 18:23:50 +0000
Subject: [PATCH 1/3] [CI][Github] Add Workflow to Run Python Tests in CI
Folder
This patch adds a new GHA workflow that runs pytest inside of the .ci
directory to test all of the CI infrastructure. This is to make it more
visible to new contributors that these tests exist and also to ensure
that they are passing before merge. There have been several instances
already where someone neglected to update these tests and we should have
automation to enforce this.
---
.github/workflows/check-ci.yml | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)
create mode 100644 .github/workflows/check-ci.yml
diff --git a/.github/workflows/check-ci.yml b/.github/workflows/check-ci.yml
new file mode 100644
index 0000000000000..ef05f59b81a6f
--- /dev/null
+++ b/.github/workflows/check-ci.yml
@@ -0,0 +1,33 @@
+name: Check CI
+
+permissions:
+ contents: read
+
+on:
+ push:
+ paths:
+ - '.ci/**'
+ pull_request:
+ paths:
+ - '.ci/**'
+
+jobs:
+ test-python:
+ name: "Check Python Tests"
+ runs-on: ubuntu-24.04
+ if: github.repository == 'llvm/llvm-project'
+ steps:
+ - name: Fetch LLVM sources
+ uses: actions/checkout at 11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+ with:
+ sparse-checkout: .ci/**
+ - name: Setup Python
+ uses: actions/setup-python at 42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
+ with:
+ python-version: 3.13
+ cache: 'pip'
+ - name: Install Python Dependencies
+ run: pip3 install -r .ci/all_requirements.txt
+ - name: Run Tests
+ working-direcotry: .ci
+ run: pytest
>From 7a8fc27f4c0f90872829302e05913795b439910a Mon Sep 17 00:00:00 2001
From: Aiden Grossman <aidengrossman at google.com>
Date: Mon, 14 Jul 2025 19:47:29 +0000
Subject: [PATCH 2/3] Minor fix
---
.github/workflows/check-ci.yml | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/.github/workflows/check-ci.yml b/.github/workflows/check-ci.yml
index ef05f59b81a6f..f5e1ab3d19c5f 100644
--- a/.github/workflows/check-ci.yml
+++ b/.github/workflows/check-ci.yml
@@ -7,9 +7,11 @@ on:
push:
paths:
- '.ci/**'
+ - '.github/workflows/check-ci.yml'
pull_request:
paths:
- '.ci/**'
+ - '.github/workflows/check-ci.yml'
jobs:
test-python:
@@ -29,5 +31,5 @@ jobs:
- name: Install Python Dependencies
run: pip3 install -r .ci/all_requirements.txt
- name: Run Tests
- working-direcotry: .ci
+ working-directory: .ci
run: pytest
>From 680c0256078fc4316ec54f4bafeb31b8bc630535 Mon Sep 17 00:00:00 2001
From: Aiden Grossman <aidengrossman at google.com>
Date: Mon, 14 Jul 2025 19:48:17 +0000
Subject: [PATCH 3/3] sparse fix
---
.github/workflows/check-ci.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/check-ci.yml b/.github/workflows/check-ci.yml
index f5e1ab3d19c5f..2a87889f768d0 100644
--- a/.github/workflows/check-ci.yml
+++ b/.github/workflows/check-ci.yml
@@ -22,7 +22,7 @@ jobs:
- name: Fetch LLVM sources
uses: actions/checkout at 11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
- sparse-checkout: .ci/**
+ sparse-checkout: .ci
- name: Setup Python
uses: actions/setup-python at 42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
with:
More information about the llvm-commits
mailing list