Skip to content

Commit

Permalink
Merge branch 'main' into ci-bench-cc
Browse files Browse the repository at this point in the history
Signed-off-by: Lars Eggert <[email protected]>
  • Loading branch information
larseggert authored Mar 14, 2024
2 parents f50f414 + f408321 commit 9ca5ecc
Show file tree
Hide file tree
Showing 14 changed files with 1,414 additions and 1,301 deletions.
7 changes: 3 additions & 4 deletions .github/actions/quic-interop-runner/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ runs:
cd quic-interop-runner
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
cat implementations.json
ARGS="--log-dir logs --must-include ${{ inputs.name }}"
ARGS="--log-dir logs --markdown --must-include ${{ inputs.name }}"
if [ -n "${{ inputs.client }}" ]; then
ARGS="$ARGS --client ${{ inputs.client }}"
fi
Expand All @@ -92,9 +92,8 @@ runs:
run: |
echo '[**QUIC Interop Runner**](https://github.com/quic-interop/quic-interop-runner)' >> comment
echo '' >> comment
echo '```' >> comment
cat quic-interop-runner/summary >> comment
echo '```' >> comment
# Ignore all, but table, which starts with "|:--".
cat quic-interop-runner/summary | awk '/^\|:--/{flag=1} flag' >> comment
echo '' >> comment
shell: bash

Expand Down
2 changes: 1 addition & 1 deletion .github/actions/rust/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ runs:

- name: Install Rust tools
shell: bash
run: cargo +${{ inputs.version }} binstall --no-confirm cargo-llvm-cov cargo-nextest flamegraph cargo-hack
run: cargo +${{ inputs.version }} binstall --no-confirm cargo-llvm-cov cargo-nextest flamegraph cargo-hack cargo-mutants

# sccache slows CI down, so we leave it disabled.
# Leaving the steps below commented out, so we can re-evaluate enabling it later.
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/bench-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ jobs:
permissions:
pull-requests: write
runs-on: ubuntu-latest
if: github.event.workflow_run.event == 'pull_request'
if: |
github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'success'
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/pr-comment
Expand Down
43 changes: 31 additions & 12 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ jobs:
uses: actions/cache/restore@v4
with:
path: ./target/criterion
key: criterion-${{ runner.os }}-${{ hashFiles('./target/criterion/**.json') }}
restore-keys: criterion-${{ runner.os }}-
key: criterion-${{ runner.name }}-${{ github.sha }}
restore-keys: criterion-${{ runner.name }}-

# Disable turboboost, hyperthreading and use performance governor.
- name: Prepare machine
Expand Down Expand Up @@ -118,27 +118,46 @@ jobs:
done
wait
- name: Cache main-branch results
if: github.ref == 'refs/heads/main'
uses: actions/cache/save@v4
with:
path: ./target/criterion
key: ${{ steps.criterion-cache.outputs.cache-primary-key }}

- name: Format results as Markdown
id: results
run: |
echo '### Benchmark results' > results.md
{
echo "### Benchmark results"
echo
} > results.md
SHA=$(cat target/criterion/baseline-sha.txt)
if [ -n "$SHA" ]; then
{
echo "Performance differences relative to $SHA."
echo
} >> results.md
fi
grep -Ev 'ignored|running \d+ tests|%\)' results.txt |\
sed -E -e 's/(Performance has regressed.)/:broken_heart: **\1**/gi' \
-e 's/(Performance has improved.)/:green_heart: **\1**/gi' \
-e 's/^ +/ /gi' \
-e 's/^([a-z0-9].*)$/* **\1**/gi' \
-e 's/(change:[^%]*% )([^%]*%)(.*)/\1**\2**\3/gi' \
>> results.md
echo '' >> results.md
- name: Export bench data
- name: Remember main-branch push URL
if: github.ref == 'refs/heads/main'
run: echo "${{ github.sha }}" > target/criterion/baseline-sha.txt

- name: Store history
if: github.ref == 'refs/heads/main'
run: |
mkdir -p target/criterion-history
cp -r target/criterion "target/criterion-history/$(date +%s)-${{ github.sha }}"
- name: Cache main-branch results
if: github.ref == 'refs/heads/main'
uses: actions/cache/save@v4
with:
path: ./target/criterion
key: criterion-${{ runner.name }}-${{ github.sha }}

- name: Export perf data
id: export
uses: actions/upload-artifact@v4
with:
Expand Down
55 changes: 55 additions & 0 deletions .github/workflows/mutants.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Find mutants
on:
pull_request:
branches: ["main"]
paths-ignore: ["*.md", "*.png", "*.svg", "LICENSE-*"]

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true

jobs:
incremental-mutants:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Relative diff
run: git diff origin/${{ github.base_ref }}.. > pr.diff

- name: Install dependencies
env:
DEBIAN_FRONTEND: noninteractive
run: |
sudo apt-get install -y --no-install-recommends gyp mercurial ninja-build lld
echo "RUSTFLAGS=-C link-arg=-fuse-ld=lld" >> "$GITHUB_ENV"
- name: Fetch and build NSS and NSPR
uses: ./.github/actions/nss

- name: Install Rust
uses: ./.github/actions/rust
with:
version: stable

- name: Mutants
run: |
# Don't fail the build if mutants fail, for now.
set -o pipefail
cargo mutants --test-tool=nextest --no-shuffle -j 2 -vV --in-diff pr.diff | tee results.txt || true
{
echo "### Mutants"
echo "See https://mutants.rs/using-results.html for more information."
echo '```'
cat results.txt
echo '```'
} > "$GITHUB_STEP_SUMMARY"
- name: Archive mutants.out
uses: actions/upload-artifact@v4
if: always()
with:
name: mutants.out
path: mutants.out
7 changes: 3 additions & 4 deletions .github/workflows/qns-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@ jobs:
permissions:
pull-requests: write
runs-on: ubuntu-latest
# if: >
# github.event.workflow_run.event == 'pull_request' &&
# github.event.workflow_run.conclusion == 'failure'
if: github.event.workflow_run.event == 'pull_request'
if: |
github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'failure'
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/pr-comment
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ resolver = "2"
homepage = "https://github.com/mozilla/neqo/"
repository = "https://github.com/mozilla/neqo/"
authors = ["The Neqo Authors <[email protected]>"]
version = "0.7.1"
version = "0.7.2"
# Keep in sync with `.rustfmt.toml` `edition`.
edition = "2021"
license = "MIT OR Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion neqo-bin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ license.workspace = true

[[bin]]
name = "neqo-client"
path = "src/bin/client.rs"
path = "src/bin/client/main.rs"
bench = false

[[bin]]
Expand Down
Loading

0 comments on commit 9ca5ecc

Please sign in to comment.