|
| 1 | +name: 'QUIC Interop Runner Action' |
| 2 | +description: 'Run the QUIC Interop Runner tests.' |
| 3 | +author: 'mxinden' |
| 4 | + |
| 5 | +inputs: |
| 6 | + name: |
| 7 | + description: 'Name of the QUIC implementation' |
| 8 | + required: true |
| 9 | + image: |
| 10 | + description: 'Docker image to be tested. Needs to reside either locally, or on some registry.' |
| 11 | + required: true |
| 12 | + url: |
| 13 | + description: 'URL of the QUIC implementation' |
| 14 | + required: true |
| 15 | + role: |
| 16 | + description: 'client/server/both' |
| 17 | + required: false |
| 18 | + default: 'both' |
| 19 | + client: |
| 20 | + description: 'client implementations (comma-separated)' |
| 21 | + required: false |
| 22 | + default: '' |
| 23 | + server: |
| 24 | + description: 'server implementations (comma-separated)' |
| 25 | + required: false |
| 26 | + default: '' |
| 27 | + test: |
| 28 | + description: 'test cases (comma-separatated)' |
| 29 | + required: false |
| 30 | + default: '' |
| 31 | + |
| 32 | +runs: |
| 33 | + using: "composite" |
| 34 | + steps: |
| 35 | + - name: Checkout quic-interop/quic-interop-runner repository |
| 36 | + uses: actions/checkout@v4 |
| 37 | + with: |
| 38 | + repository: 'quic-interop/quic-interop-runner' |
| 39 | + path: 'quic-interop-runner' |
| 40 | + |
| 41 | + - name: Enable IPv6 support |
| 42 | + run: sudo modprobe ip6table_filter |
| 43 | + shell: bash |
| 44 | + |
| 45 | + - name: Install dependencies |
| 46 | + run: | |
| 47 | + sudo add-apt-repository ppa:wireshark-dev/stable |
| 48 | + sudo apt-get update |
| 49 | + sudo apt-get install -y wireshark tshark jq |
| 50 | + shell: bash |
| 51 | + |
| 52 | + - uses: actions/setup-python@v5 |
| 53 | + with: |
| 54 | + python-version: 3.8 |
| 55 | + cache: 'pip' |
| 56 | + cache-dependency-path: 'quic-interop-runner/requirements.txt' |
| 57 | + |
| 58 | + - name: Install Python packages |
| 59 | + run: | |
| 60 | + cd quic-interop-runner |
| 61 | + pip install -U pip |
| 62 | + pip install -r requirements.txt |
| 63 | + shell: bash |
| 64 | + |
| 65 | + - name: Run tests |
| 66 | + id: test-run |
| 67 | + run: | |
| 68 | + cd quic-interop-runner |
| 69 | + jq --arg key "${{ inputs.name }}" --argjson newEntry '{"image": "${{ inputs.image }}", "url": "${{ inputs.url }}", "role": "${{ inputs.role }}"}' '.[$key] = $newEntry' implementations.json > temp.$$ && mv temp.$$ implementations.json |
| 70 | + cat implementations.json |
| 71 | + ARGS="--log-dir logs --must-include ${{ inputs.name }}" |
| 72 | + if [ -n "${{ inputs.client }}" ]; then |
| 73 | + ARGS="$ARGS --client ${{ inputs.client }}" |
| 74 | + fi |
| 75 | + if [ -n "${{ inputs.server }}" ]; then |
| 76 | + ARGS="$ARGS --server ${{ inputs.server }}" |
| 77 | + fi |
| 78 | + if [ -n "${{ inputs.test }}" ]; then |
| 79 | + ARGS="$ARGS --test ${{ inputs.test }}" |
| 80 | + fi |
| 81 | + python run.py $ARGS 2>&1 | tee summary |
| 82 | + shell: bash |
| 83 | + |
| 84 | + - uses: actions/upload-artifact@v4 |
| 85 | + id: artifact-upload-step |
| 86 | + if: always() |
| 87 | + with: |
| 88 | + name: logs |
| 89 | + path: quic-interop-runner/logs |
| 90 | + |
| 91 | + # This action might be running off of a fork and would thus not have write |
| 92 | + # permissions on the origin repository. In order to allow a separate |
| 93 | + # priviledged action to post a comment on a pull request, upload the |
| 94 | + # necessary metadata. |
| 95 | + - name: store comment-data |
| 96 | + shell: bash |
| 97 | + if: github.event_name == 'pull_request' |
| 98 | + env: |
| 99 | + PULL_REQUEST_NUMBER: ${{ github.event.number }} |
| 100 | + run: | |
| 101 | + mkdir comment-data |
| 102 | + mv quic-interop-runner/summary comment-data/summary |
| 103 | + echo $PULL_REQUEST_NUMBER > comment-data/pr-number |
| 104 | + echo '${{ steps.artifact-upload-step.outputs.artifact-url }}' > comment-data/logs-url |
| 105 | +
|
| 106 | + - name: Upload comment data |
| 107 | + uses: actions/upload-artifact@v4 |
| 108 | + if: github.event_name == 'pull_request' |
| 109 | + with: |
| 110 | + name: comment-data |
| 111 | + path: ./comment-data |
0 commit comments