]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
.github: Run cephadm tox tests when necessary 46649/head
authorZack Cerza <zack@redhat.com>
Mon, 13 Jun 2022 21:02:31 +0000 (15:02 -0600)
committerZack Cerza <zack@redhat.com>
Mon, 13 Jun 2022 21:17:31 +0000 (15:17 -0600)
This can easily be extended for our other Python components.

Signed-off-by: Zack Cerza <zack@redhat.com>
.github/workflows/tox.yml [new file with mode: 0644]

diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml
new file mode 100644 (file)
index 0000000..652b9fe
--- /dev/null
@@ -0,0 +1,32 @@
+name: Run tox tests
+on: pull_request
+
+jobs:
+  changes:
+    runs-on: ubuntu-latest
+    outputs:
+      cephadm: ${{ steps.filter.outputs.cephadm }}
+    steps:
+      - uses: dorny/paths-filter@v2
+        id: filter
+        with:
+          filters: |
+            cephadm:
+              - 'src/cephadm/cephadm'
+              - 'src/cephadm/**/*.py'
+              - 'src/cephadm/tox.ini'
+  cephadm:
+    needs: changes
+    runs-on: ubuntu-latest
+    if: ${{ needs.changes.outputs.cephadm == 'true' }}
+    steps:
+      - uses: actions/checkout@v2
+      - name: Setup Python
+        uses: actions/setup-python@v2
+        with:
+          python-version: "3.7"
+      - name: Install tox
+        run: pip install tox
+      - name: Run tox
+        run: tox
+        working-directory: "src/cephadm/"