Skip to content

Commit

Permalink
DO-NOT-MERGE: mptcp: add GitHub Actions
Browse files Browse the repository at this point in the history
Currently supported:

- build-validation: check different combinations of validation
- irc: send notifications to the IRC channel
- update-tg-tree: periodically or manually sync with net-next

Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
  • Loading branch information
matttbe committed Apr 22, 2021
1 parent c407345 commit 721b0ae
Show file tree
Hide file tree
Showing 4 changed files with 209 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .cirrus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@

# Launch 2 jobs in //: with and without debug
task:
name: KVM validation
only_if: $CIRRUS_TAG != '' ## only tags

container:
image: mptcp/mptcp-upstream-virtme-docker
kvm: true ## Needed for the tests
cpu: 8 ## Max 16 per project, even number with kvm
memory: 8G ## Max 4 per CPU

env:
CIRRUS_CLONE_DEPTH: 1 ## no need to have a full clone
CIRRUS_LOG_TIMESTAMP: true ## useful
INPUT_CCACHE_MAXSIZE: 1G
matrix:
MATRIX_JOB: normal
MATRIX_JOB: debug

ccache_cache:
folder: ".virtme/ccache"
reupload_on_changes: true
fingerprint_script:
- echo ${MATRIX_JOB}

test_script: /entrypoint.sh expect-${MATRIX_JOB}

always:
conclusion_artifacts:
path: "conclusion.txt"
type: text/plain
summary_artifacts:
path: "summary.txt"
type: text/plain
tap_result_artifacts:
path: "*.tap"
type: text/plain
# JUnit format is for the moment only useful for PR but publish them just in case for later
junit_artifacts:
path: "*.tap.xml"
type: text/xml
format: junit
43 changes: 43 additions & 0 deletions .github/workflows/build-validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: "MPTCP Upstream Build Validation"
on:
push:
branches-ignore:
- 'archived/**' # previous branches
- 't/**' # TopGit tree
- 'net-next' # part of the TopGit tree
- 'for-review' # part of the TopGit tree
- 'export' # part of the TopGit tree
tags:
- 'export/**' # the CI create a new tag once there is a new export
- 'patchew/**' # patchew is using tags

jobs:
build:
name: "Build (matrix)"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
defconfig: ['x86_64', 'i386']
ipv6: ['with_ipv6', 'without_ipv6']
mptcp: ['with_mptcp', 'without_mptcp']
steps:
- name: "Checkout"
uses: actions/checkout@v2
with:
fetch-depth: 100 # we should not have more commits on top of net-next/export
- name: "Setup cache for CCache"
uses: actions/cache@v2
with:
path: ${{ github.workspace }}/.ccache
key: ${{ runner.os }}-build-${{ matrix.defconfig }}-${{ matrix.ipv6 }}-${{ matrix.mptcp }}-${{ github.run_id }}-${{ github.sha }}
restore-keys: ${{ runner.os }}-build-${{ matrix.defconfig }}-${{ matrix.ipv6 }}-${{ matrix.mptcp }}-
- name: "Build Validation"
uses: multipath-tcp/mptcp-upstream-validate-export-action@main
with:
# we want to validate each commits on top of net-next/export except for stable
each_commit: ${{ ! startswith(github.ref, 'refs/heads/stable/') }}
ccache_maxsize: 620M ## 5/2^3=625: 5GB = project limit ; 2^3 = matrix
defconfig: ${{ matrix.defconfig }}
ipv6: ${{ matrix.ipv6 }}
mptcp: ${{ matrix.mptcp }}
91 changes: 91 additions & 0 deletions .github/workflows/irc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: "IRC Notifications"
on:
create:
issues:
types: [opened, reopened, closed, assigned, unassigned]
workflow_run:
workflows: ["MPTCP Upstream Build Validation"]
types:
- completed
check_suite:
types:
- completed

jobs:
irc-tag:
name: "IRC Tag"
if: github.repository_owner == 'multipath-tcp' && github.event_name == 'create' && github.event.ref_type == 'tag'
runs-on: ubuntu-latest
steps:
- name: irc tag
uses: rectalogic/notify-irc@v1
with:
channel: "#MPTCPUpstream"
nickname: gh-tag-bot
message: "New tag available: ${{ github.event.ref }} (by ${{ github.actor }})"

irc-issues:
name: "IRC Issues"
if: github.repository_owner == 'multipath-tcp' && github.event_name == 'issues'
runs-on: ubuntu-latest
steps:
- name: irc issues
uses: rectalogic/notify-irc@v1
with:
channel: "#MPTCPUpstream"
nickname: gh-issues-bot
message: |-
Issue #${{ github.event.issue.number }} has been ${{ github.event.action }} by ${{ github.actor }}.
Issue title: "${{ github.event.issue.title }}"
Issue opened by: ${{ github.event.issue.user.login }}
Assignee (if any): ${{ github.event.assignee.login }}
URL: ${{ github.event.issue.html_url }}
irc-build:
name: "IRC Build"
if: github.repository_owner == 'multipath-tcp' && github.event_name == 'workflow_run'
runs-on: ubuntu-latest
steps:
- name: irc build
uses: rectalogic/notify-irc@v1
with:
channel: "#MPTCPUpstream"
nickname: gh-build-bot
message: |-
New build validating ${{ github.event.workflow_run.head_branch }} (by ${{ github.actor }}) ended with ${{ github.event.workflow_run.conclusion }}
https://github.com/${{ github.repository }}/actions/runs/${{ github.event.workflow_run.id }}
irc-tests:
name: "IRC Tests"
if: github.repository_owner == 'multipath-tcp' && github.event_name == 'check_suite' && github.event.check_suite.app.name == 'Cirrus CI'
runs-on: ubuntu-latest
steps:
# from: https://cirrus-ci.org/guide/notifications/
- name: get status
uses: octokit/request-action@v2.x
id: get_status_check_run
with:
route: GET /repos/${{ github.repository }}/check-suites/${{ github.event.check_suite.id }}/check-runs?status=completed
mediaType: '{"previews": ["antiope"]}'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: get conclusion
id: get_conclusion_cirrus
run: |
echo "::set-output name=conclusion_0::$(curl ${CHECK_0_URL} || echo "0: Unable to get the conclusion")"
echo "::set-output name=conclusion_1::$(curl ${CHECK_1_URL} || echo "1: Unable to get the conclusion")"
env:
CHECK_0_URL: "https://api.cirrus-ci.com/v1/artifact/task/${{ fromJson(steps.get_status_check_run.outputs.data).check_runs[0].external_id }}/conclusion/conclusion.txt"
CHECK_1_URL: "https://api.cirrus-ci.com/v1/artifact/task/${{ fromJson(steps.get_status_check_run.outputs.data).check_runs[1].external_id }}/conclusion/conclusion.txt"
- name: irc tests
uses: rectalogic/notify-irc@v1
with:
channel: "#MPTCPUpstream"
nickname: gh-tests-bot
message: |-
New Tests job validating ${{ github.event.check_suite.head_branch }} (by ${{ github.actor }}) just ended:
- ${{ steps.get_conclusion_cirrus.outputs.conclusion_0 }}: ${{ env.CHECK_0_URL }}
- ${{ steps.get_conclusion_cirrus.outputs.conclusion_1 }}: ${{ env.CHECK_1_URL }}
env:
CHECK_0_URL: ${{ fromJson(steps.get_status_check_run.outputs.data).check_runs[0].details_url }}
CHECK_1_URL: ${{ fromJson(steps.get_status_check_run.outputs.data).check_runs[1].details_url }}
32 changes: 32 additions & 0 deletions .github/workflows/update-tg-tree.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: "Update TopGit tree"

on:
workflow_dispatch:
inputs:
keep_base_untouched:
description: 'Set it to 1 to force a sync without updating the base from upstream'
required: true
default: '0'
force_sync:
description: 'Set it to 1 to force a sync even if net-next is not updated'
required: true
default: '0'

schedule:
- cron: '33 5 * * *' # in UTC: after US West coast's work day

jobs:
export:
if: github.repository_owner == 'multipath-tcp'
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v2
with:
fetch-depth: 0 # we need all commits for TopGit
token: '${{ secrets.PAT_JENKINS_TESSARES }}'
- name: "Update TG tree"
uses: multipath-tcp/mptcp-upstream-topgit-action@main
with:
not_base: "${{ github.event.inputs.keep_base_untouched || '0' }}"
force_sync: "${{ github.event.inputs.force_sync || '0' }}"

0 comments on commit 721b0ae

Please sign in to comment.