Skip to content

Commit

Permalink
gh: new action to run tests
Browse files Browse the repository at this point in the history
We need to measure the impact of having only 2 CPUs and no KVM support.

Signed-off-by: Matthieu Baerts <matttbe@kernel.org>
  • Loading branch information
matttbe committed Dec 22, 2023
1 parent a91ec57 commit 1189c35
Showing 1 changed file with 93 additions and 0 deletions.
93 changes: 93 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -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:

0 comments on commit 1189c35

Please sign in to comment.