]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
github/workflows: add support for testing different cgroup setups
authorKamalesh Babulal <kamalesh.babulal@oracle.com>
Wed, 31 Aug 2022 14:25:16 +0000 (08:25 -0600)
committerTom Hromatka <tom.hromatka@oracle.com>
Wed, 31 Aug 2022 14:25:24 +0000 (08:25 -0600)
Add support to run the Github workflow on three parallel runners, each
of them have a unique cgroup setup:
cgroup v1 only (legacy), cgroup v1/v2 (hybrid), cgroup v2 only (unified).

With this change, we should be able to run every patch against all
combination of cgroup setups.

Suggested-by: Tom Hromatka <tom.hromatka@oracle.com>
Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
TJH: Remove the clean logic and instead use the Github Actions
$ACTIONS_RUNNER_HOOK_JOB_STARTED environment variable

.github/workflows/continuous-integration.yml

index e7432093cd3667075fbfe9be6ed8dd463bf3096d..a996f9b8612a46b05b3a32d6f0e786a5828604ef 100644 (file)
@@ -23,17 +23,6 @@ name: Continuous Integration
 on: ["push", "pull_request"]
 
 jobs:
-  # Thanks to github user @martyrs
-  # https://github.community/t/how-to-properly-clean-up-self-hosted-runners/128909/3
-  cleaner:
-    name: Delete Self-Hosted Runner Workspaces
-    runs-on: self-hosted
-    steps:
-      - name: Delete workspace path
-        run: |
-          echo "Cleaning up previous run"
-          rm -rf "${{ github.workspace }}"
-
   codeql:
     name: CodeQL
     runs-on: ubuntu-latest
@@ -235,10 +224,99 @@ jobs:
         name: Cgroup v1v2 Code Coverage
         path: lcov.*
 
-  functionaltestsv2:
-    name: Cgroup v2 Functional Tests
-    needs: [cleaner]
-    runs-on: self-hosted
+  functionaltestsv2_legacy:
+    name: Cgroup v2 Functional Tests - legacy
+    runs-on: cgroup-legacy
+
+    steps:
+    - uses: actions/checkout@v2
+      with:
+        submodules: false
+    - name: Initialize the directory
+      uses: ./.github/actions/setup-libcgroup
+    - name: Run functional tests
+      run: |
+        pushd src/python/build/lib.*
+        export PYTHONPATH=$PYTHONPATH:$(pwd)
+        popd
+        pushd tests/ftests
+        make check
+        popd
+    - name: Display test logs
+      if: ${{ always() }}
+      run: |
+        cat tests/ftests/ftests.sh.log
+        cat tests/ftests/ftests-nocontainer.sh.log
+    - name: Archive test logs
+      if: ${{ always() }}
+      uses: actions/upload-artifact@v2
+      with:
+        name: Cgroup v2 test logs - legacy
+        path: tests/ftests/*.log
+    - name: Collate code coverage results
+      uses: ./.github/actions/code-coverage
+    - name: Upload code coverage results
+      uses: coverallsapp/github-action@master
+      with:
+        github-token: ${{ secrets.GITHUB_TOKEN }}
+        path-to-lcov: ./lcov.total
+        flag-name: "Cgroup v2 Functional Tests - legacy"
+        parallel: True
+    - name: Archive code coverage results
+      if: ${{ always() }}
+      uses: actions/upload-artifact@v2
+      with:
+        name: Cgroup v2 Code Coverage - legacy
+        path: lcov.*
+
+  functionaltestsv2_hybrid:
+    name: Cgroup v2 Functional Tests - hybrid
+    runs-on: cgroup-hybrid
+
+    steps:
+    - uses: actions/checkout@v2
+      with:
+        submodules: false
+    - name: Initialize the directory
+      uses: ./.github/actions/setup-libcgroup
+    - name: Run functional tests
+      run: |
+        pushd src/python/build/lib.*
+        export PYTHONPATH=$PYTHONPATH:$(pwd)
+        popd
+        pushd tests/ftests
+        make check
+        popd
+    - name: Display test logs
+      if: ${{ always() }}
+      run: |
+        cat tests/ftests/ftests.sh.log
+        cat tests/ftests/ftests-nocontainer.sh.log
+    - name: Archive test logs
+      if: ${{ always() }}
+      uses: actions/upload-artifact@v2
+      with:
+        name: Cgroup v2 test logs - hybrid
+        path: tests/ftests/*.log
+    - name: Collate code coverage results
+      uses: ./.github/actions/code-coverage
+    - name: Upload code coverage results
+      uses: coverallsapp/github-action@master
+      with:
+        github-token: ${{ secrets.GITHUB_TOKEN }}
+        path-to-lcov: ./lcov.total
+        flag-name: "Cgroup v2 Functional Tests - hybrid"
+        parallel: True
+    - name: Archive code coverage results
+      if: ${{ always() }}
+      uses: actions/upload-artifact@v2
+      with:
+        name: Cgroup v2 Code Coverage - hybrid
+        path: lcov.*
+
+  functionaltestsv2_unified:
+    name: Cgroup v2 Functional Tests - unified
+    runs-on: cgroup-unified
 
     steps:
     - uses: actions/checkout@v2
@@ -263,7 +341,7 @@ jobs:
       if: ${{ always() }}
       uses: actions/upload-artifact@v2
       with:
-        name: Cgroup v2 test logs
+        name: Cgroup v2 test logs - unified
         path: tests/ftests/*.log
     - name: Collate code coverage results
       uses: ./.github/actions/code-coverage
@@ -272,19 +350,20 @@ jobs:
       with:
         github-token: ${{ secrets.GITHUB_TOKEN }}
         path-to-lcov: ./lcov.total
-        flag-name: "Cgroup v2 Functional Tests"
+        flag-name: "Cgroup v2 Functional Tests - unified"
         parallel: True
     - name: Archive code coverage results
       if: ${{ always() }}
       uses: actions/upload-artifact@v2
       with:
-        name: Cgroup v2 Code Coverage
+        name: Cgroup v2 Code Coverage - unified
         path: lcov.*
 
   finalize:
     name: Finalize the test run
     if: ${{ always() }}
-    needs: [unittests, functionaltestsv1, functionaltestsv1v2, functionaltestsv2]
+    needs: [unittests, functionaltestsv1, functionaltestsv1v2, functionaltestsv2_legacy,
+            functionaltestsv2_hybrid, functionaltestsv2_unified]
     runs-on: ubuntu-latest
     steps:
     - name: Finalize code coverage results