From: Kamalesh Babulal Date: Wed, 31 Aug 2022 14:25:16 +0000 (-0600) Subject: github/workflows: add support for testing different cgroup setups X-Git-Tag: v3.1.0~315 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=995202c4f53fe6c7d5b90e95c58f77c7a4280d71;p=thirdparty%2Flibcgroup.git github/workflows: add support for testing different cgroup setups 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 Signed-off-by: Kamalesh Babulal Signed-off-by: Tom Hromatka TJH: Remove the clean logic and instead use the Github Actions $ACTIONS_RUNNER_HOOK_JOB_STARTED environment variable --- diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index e7432093..a996f9b8 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -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