From 1189c35b610b07b06ab29f58b742122cece56757 Mon Sep 17 00:00:00 2001 From: Matthieu Baerts Date: Fri, 22 Dec 2023 14:51:11 +0100 Subject: [PATCH] gh: new action to run tests We need to measure the impact of having only 2 CPUs and no KVM support. Signed-off-by: Matthieu Baerts --- .github/workflows/tests.yml | 93 +++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000000000..093d825d1e6b9 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,93 @@ +name: "MPTCP Upstream Tests Validation" +on: + push: + branches-ignore: + - 'archived/**' # previous branches + - 't/**' # TopGit tree + - 'net' # part of the TopGit tree + - 'net-next' # part of the TopGit tree + - 'for-review' # part of the TopGit tree + - 'for-review-net' # part of the TopGit tree + tags: + - 'patchew/**' # patchew is using tags + # ideally, we would take 'export/**' but the cache is per branch... + # In other words, when using tags, we can only use the cache if we re-tag. + # https://github.com/actions/cache/issues/556 + # So we test the "export" branch and we try to find the tag later + +permissions: {} + +jobs: + tests: + name: "Tests (matrix)" + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + mode: ['normal', 'debug'] + # TODO: selftest_mptcp_join: ['INPUT_RUN_TESTS_EXCEPT', 'INPUT_RUN_TESTS_ONLY'] + permissions: + contents: read # to fetch code (actions/checkout) + + steps: + - name: "Checkout" + uses: actions/checkout@v3 + + - name: "Find base branch" + id: branch + run: | + if [ "$(cat .git_markup)" = "MPTCP-related modifications only needed for our tests suite (mptcp-net)." ]; then + echo "name=export-net" >> ${GITHUB_OUTPUT} + else + echo "name=export" >> ${GITHUB_OUTPUT} + fi + + - name: "Restore cache for CCache" + uses: actions/cache/restore@v3 + id: restore-ccache + with: + path: ${{ github.workspace }}/.ccache + key: ${{ runner.os }}_tests_${{ steps.branch.outputs.name }}-${{ github.run_id }}-${{ github.run_attempt }}-${{ github.sha }} + restore-keys: | + ${{ runner.os }}_tests_${{ steps.branch.outputs.name }}-${{ github.run_id }}-${{ github.run_attempt }}-${{ github.sha }} + ${{ runner.os }}_tests_${{ steps.branch.outputs.name }}-${{ github.run_id }}-${{ github.run_attempt }}- + ${{ runner.os }}_tests_${{ steps.branch.outputs.name }}-${{ github.run_id }}- + ${{ runner.os }}_tests_${{ steps.branch.outputs.name }}- + + - name: "Tests" + uses: multipath-tcp/mptcp-upstream-virtme-docker@latest + with: + ccache_maxsize: 600M ## 10/2^3/2=625: 10GB = project limit ; 2^3 = matrix ; 2: -net and net-next + mode: ${{ matrix.mode }} + # TODO: selftest_mptcp_join_only_except: ${{ matrix.selftest_mptcp_join }} + + - name: "Artifacts (always)" + if: always() + uses: actions/upload-artifact@v4 + with: + name: results + path: | + conclusion.txt + summary.txt + *.tap + config.zstd + *.tap.xml + + - name: "Artifacts (failure)" + if: failure() + uses: actions/upload-artifact@v4 + with: + name: results + path: | + vmlinux.zstd + kmemleak.txt + + - name: "Save cache for CCache" + if: github.ref == 'refs/heads/export' || github.ref == 'refs/heads/export-net' + uses: actions/cache/save@v3 + with: + path: ${{ github.workspace }}/.ccache + key: ${{ steps.restore-ccache.outputs.cache-primary-key }} + + # TODO: see build-validation.yml + # notif: \ No newline at end of file