Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add github action #356

Open
wants to merge 28 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
bc9feca
feat: add github action
mxinden Feb 24, 2024
9f7a74d
Add pull_request_target
mxinden Feb 24, 2024
58e4d9a
Revert "Add pull_request_target"
mxinden Feb 24, 2024
03da3ad
Split into unpriviledged and priviledged workflow
mxinden Feb 26, 2024
ba32ba4
Trigger CI
mxinden Feb 26, 2024
6818368
Use --must-include
mxinden Mar 1, 2024
58d614c
Merge branch 'master' of https://github.com/quic-interop/quic-interop…
mxinden Mar 1, 2024
934d374
reference latest
mxinden Mar 1, 2024
69fcd42
Remove wrapping object
mxinden Mar 1, 2024
aa3a746
Add client, server and test argument option
mxinden Mar 1, 2024
0f10426
debug args
mxinden Mar 1, 2024
3a75b8f
Include itself
mxinden Mar 1, 2024
96e38f8
Revert "debug args"
mxinden Mar 1, 2024
bb61dc3
Update
mxinden Mar 1, 2024
af5942e
rename workflows
mxinden Mar 5, 2024
163cca4
restrict client and server set
mxinden Mar 5, 2024
336dd78
rename job
mxinden Mar 5, 2024
4828b85
Revert "restrict client and server set"
mxinden Mar 5, 2024
e3c6e4c
Only comment on failure
mxinden Mar 11, 2024
ee0c7ed
Update comment in-place
mxinden Mar 11, 2024
dfa7391
Merge branch 'master' of https://github.com/quic-interop/quic-interop…
mxinden Mar 11, 2024
9277333
Remove debugging docker image ls
mxinden Mar 11, 2024
5682ad0
Enable python pip caching
mxinden Mar 11, 2024
6b1760e
Re-introduce checkout
mxinden Mar 11, 2024
b7be2ce
Use --markdown
mxinden Mar 25, 2024
b98691e
Don't access uninitialized field
mxinden Mar 25, 2024
7635261
Use bugfix
mxinden Mar 25, 2024
64ad7ad
Merge branch 'master' of https://github.com/quic-interop/quic-interop…
mxinden Mar 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/test_action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: quic-interop-runner

on:
pull_request:
mxinden marked this conversation as resolved.
Show resolved Hide resolved
workflow_dispatch:

jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

# Build your Docker image.

- name: Run QUIC Interop tests
uses: ./
with:
name: 'neqo'
# Replace with the name of the freshly-build local docker image.
image: 'ghcr.io/mozilla/neqo-qns:latest'
url: https://github.com/mozilla/neqo
56 changes: 56 additions & 0 deletions .github/workflows/test_action_comment.yml
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This workflow will only execute once it is merged into master. In other words, once it is merged, a comment will appear on all future pull requests.

Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Post test results as pull request comment.
#
# This is done as a separate workflow as it requires write permissions. The
# tests itself might run off of a fork, i.e. an untrusted environment and should
# thus not be granted write permissions.

name: Comment on the pull request

on:
workflow_run:
workflows: ["quic-interop-runner"]
types:
- completed

jobs:
upload:
permissions:
pull-requests: write
runs-on: ubuntu-latest
if: >
github.event.workflow_run.event == 'pull_request'
steps:
- name: Download comment-data
uses: dawidd6/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
workflow: main.yml
run_id: ${{ github.event.workflow_run.id }}
name: comment-data

- name: Format GitHub comment
run: |
pwd
ls -la
echo '[**QUIC Interop Runner**](https://github.com/quic-interop/quic-interop-runner)' >> comment
echo '' >> comment
echo '```' >> comment
cat summary >> comment
echo '```' >> comment
echo '' >> comment
echo 'Download artifacts [here](' >> comment
cat logs-url >> comment
echo ').' >> comment
if: always()
shell: bash

- name: Read PR Number
id: pr-number
run: echo "::set-output name=number::$(cat pr-number)"
shell: bash

- name: Comment PR
uses: thollander/actions-comment-pull-request@v2
with:
filePath: comment
pr_number: ${{ steps.pr-number.outputs.number }}
89 changes: 89 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: 'QUIC Interop Runner Action'
description: 'Run the QUIC Interop Runner tests.'
author: 'mxinden'

inputs:
name:
description: 'Name of the QUIC implementation'
required: true
image:
description: 'Docker image to be tested. Needs to reside either locally, or on some registry.'
required: true
url:
description: 'URL of the QUIC implementation'
required: true
role:
description: 'client/server/both'
required: false
default: 'both'

runs:
using: "composite"
steps:
- name: Install dependencies
run: |
sudo add-apt-repository ppa:wireshark-dev/stable
sudo apt-get update
sudo apt-get install -y wireshark tshark
shell: bash

- uses: actions/setup-python@v4
with:
python-version: 3.8

- name: Enable IPv6 support
run: sudo modprobe ip6table_filter
shell: bash

- name: Checkout quic-interop/quic-interop-runner repository
uses: actions/checkout@v2
with:
repository: 'quic-interop/quic-interop-runner'
path: 'quic-interop-runner'

- name: Install Python packages
run: |
cd quic-interop-runner
pip install -U pip
pip install -r requirements.txt
shell: bash

- run: docker image ls
shell: bash

- name: Run tests
id: test-run
run: |
cd quic-interop-runner
echo '{"neqo": {"image": "${{ inputs.image }}", "url": "${{ inputs.name }}", "role": "${{ inputs.role }}"}}' > implementations.json
mxinden marked this conversation as resolved.
Show resolved Hide resolved
python run.py --test handshake --log-dir logs 2>&1 | tee summary
shell: bash

- uses: actions/upload-artifact@v4
id: artifact-upload-step
if: always()
with:
name: logs
path: quic-interop-runner/logs

# This action might be running off of a fork and would thus not have write
# permissions on the origin repository. In order to allow a separate
# priviledged action to post a comment on a pull request, upload the
# necessary metadata.
- name: store comment-data
shell: bash
if: github.event_name == 'pull_request'
env:
PULL_REQUEST_NUMBER: ${{ github.event.number }}
run: |
mkdir comment-data
mv quic-interop-runner/summary comment-data/summary
echo $PULL_REQUEST_NUMBER > comment-data/pr-number
echo '${{ steps.artifact-upload-step.outputs.artifact-url }}' > comment-data/logs-url

- name: Upload comment data
uses: actions/upload-artifact@v2
if: github.event_name == 'pull_request'
with:
name: comment-data
path: ./comment-data
Loading