-
Notifications
You must be signed in to change notification settings - Fork 180
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into remove-sync-peers-on-remove-replica
- Loading branch information
Showing
22 changed files
with
1,032 additions
and
709 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Run tests using the beta Rust compiler | ||
|
||
name: Beta Rust | ||
|
||
on: | ||
schedule: | ||
# 06:50 UTC every Monday | ||
- cron: '50 6 * * 1' | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: beta-${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
tests: | ||
uses: './.github/workflows/tests.yaml' | ||
with: | ||
rust-version: beta | ||
notify: | ||
needs: tests | ||
if: ${{ always() }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Extract test results | ||
run: | | ||
printf '${{ toJSON(needs) }}\n' | ||
result=$(echo '${{ toJSON(needs) }}' | jq -r .tests.result) | ||
echo TESTS_RESULT=$result | ||
echo "TESTS_RESULT=$result" >>"$GITHUB_ENV" | ||
- name: Notify discord on failure | ||
uses: n0-computer/discord-webhook-notify@v1 | ||
if: ${{ env.TESTS_RESULT == 'failure' }} | ||
with: | ||
severity: error | ||
details: | | ||
Rustc beta tests failed | ||
See https://github.com/n0-computer/iroh/actions/workflows/beta.yaml | ||
webhookUrl: ${{ secrets.DISCORD_N0_GITHUB_CHANNEL_WEBHOOK_URL }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,13 +2,14 @@ name: CI | |
|
||
on: | ||
pull_request: | ||
types: [ 'labeled', 'unlabeled', 'opened', 'synchronize', 'reopened' ] | ||
merge_group: | ||
push: | ||
branches: | ||
- main | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
group: ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
|
@@ -20,163 +21,13 @@ env: | |
SCCACHE_CACHE_SIZE: "50G" | ||
|
||
jobs: | ||
build_and_test_nix: | ||
timeout-minutes: 30 | ||
name: "Tests" | ||
runs-on: ${{ matrix.runner }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
name: [ubuntu-latest, macOS-arm-latest] | ||
rust: [nightly, stable] | ||
features: [all, none, default] | ||
include: | ||
- name: ubuntu-latest | ||
os: ubuntu-latest | ||
release-os: linux | ||
release-arch: amd64 | ||
runner: [self-hosted, linux, X64] | ||
- name: macOS-arm-latest | ||
os: macOS-latest | ||
release-os: darwin | ||
release-arch: aarch64 | ||
runner: [self-hosted, macOS, ARM64] | ||
env: | ||
# Using self-hosted runners so use local cache for sccache and | ||
# not SCCACHE_GHA_ENABLED. | ||
RUSTC_WRAPPER: "sccache" | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@master | ||
with: | ||
submodules: recursive | ||
|
||
- name: Install ${{ matrix.rust }} | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ matrix.rust }} | ||
|
||
- name: Install cargo-nextest | ||
uses: taiki-e/install-action@v2 | ||
with: | ||
tool: nextest | ||
|
||
- name: Install sccache | ||
uses: mozilla-actions/[email protected] | ||
|
||
- name: Select features | ||
run: | | ||
case "${{ matrix.features }}" in | ||
all) | ||
echo "FEATURES=--all-features" >> "$GITHUB_ENV" | ||
;; | ||
none) | ||
echo "FEATURES=--no-default-features" >> "$GITHUB_ENV" | ||
;; | ||
default) | ||
echo "FEATURES=" >> "$GITHUB_ENV" | ||
;; | ||
*) | ||
exit 1 | ||
esac | ||
- name: check features | ||
run: | | ||
for i in ${CRATES_LIST//,/ } | ||
do | ||
echo "Checking $i $FEATURES" | ||
cargo check -p $i $FEATURES --lib --bins | ||
done | ||
env: | ||
RUST_LOG: ${{ runner.debug && 'DEBUG' || 'INFO'}} | ||
|
||
- name: tests | ||
run: | | ||
cargo nextest run --workspace ${{ env.FEATURES }} --lib --bins --tests | ||
env: | ||
RUST_LOG: "TRACE" | ||
|
||
- name: doctests | ||
if: ${{ matrix.features == 'all' }} | ||
run: | | ||
if [ -n "${{ runner.debug }}" ]; then | ||
export RUST_LOG=DEBUG | ||
fi | ||
cargo test --workspace --all-features --doc | ||
build_and_test_windows: | ||
timeout-minutes: 30 | ||
name: "Tests" | ||
runs-on: ${{ matrix.runner }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
name: [windows-latest] | ||
rust: [nightly, stable] | ||
features: [all, none, default] | ||
target: | ||
- x86_64-pc-windows-msvc | ||
include: | ||
- name: windows-latest | ||
os: windows | ||
runner: [self-hosted, windows, x64] | ||
env: | ||
# Using self-hosted runners so use local cache for sccache and | ||
# not SCCACHE_GHA_ENABLED. | ||
RUSTC_WRAPPER: "sccache" | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@master | ||
with: | ||
submodules: recursive | ||
|
||
- name: Install ${{ matrix.rust }} | ||
run: | | ||
rustup toolchain install ${{ matrix.rust }} | ||
rustup toolchain default ${{ matrix.rust }} | ||
rustup target add ${{ matrix.target }} | ||
rustup set default-host ${{ matrix.target }} | ||
- name: Install cargo-nextest | ||
shell: powershell | ||
run: | | ||
$tmp = New-TemporaryFile | Rename-Item -NewName { $_ -replace 'tmp$', 'zip' } -PassThru | ||
Invoke-WebRequest -OutFile $tmp https://get.nexte.st/latest/windows | ||
$outputDir = if ($Env:CARGO_HOME) { Join-Path $Env:CARGO_HOME "bin" } else { "~/.cargo/bin" } | ||
$tmp | Expand-Archive -DestinationPath $outputDir -Force | ||
$tmp | Remove-Item | ||
- name: Select features | ||
run: | | ||
switch ("${{ matrix.features }}") { | ||
"all" { | ||
echo "FEATURES=--all-features" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append | ||
} | ||
"none" { | ||
echo "FEATURES=--no-default-features" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append | ||
} | ||
"default" { | ||
echo "FEATURES=" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append | ||
} | ||
default { | ||
Exit 1 | ||
} | ||
} | ||
# TODO: disabled while we do not have Powershell 7+ on the runner | ||
# as default shell. See https://github.com/actions/toolkit/issues/1179 | ||
- name: Install sccache | ||
uses: mozilla-actions/[email protected] | ||
|
||
- uses: msys2/setup-msys2@v2 | ||
|
||
- name: tests | ||
run: | | ||
cargo nextest run --workspace ${{ env.FEATURES }} --lib --bins --tests --target ${{ matrix.target }} | ||
env: | ||
RUST_LOG: "TRACE" | ||
tests: | ||
name: CI Test Suite | ||
if: "github.event_name != 'pull_request' || ! contains(github.event.pull_request.labels.*.name, 'flaky-test')" | ||
uses: './.github/workflows/tests.yaml' | ||
|
||
cross: | ||
if: "github.event_name != 'pull_request' || ! contains(github.event.pull_request.labels.*.name, 'flaky-test')" | ||
timeout-minutes: 30 | ||
name: Cross compile | ||
runs-on: [self-hosted, linux, X64] | ||
|
@@ -274,6 +125,7 @@ jobs: | |
run: cargo clippy --workspace --all-targets | ||
|
||
msrv: | ||
if: "github.event_name != 'pull_request' || ! contains(github.event.pull_request.labels.*.name, 'flaky-test')" | ||
timeout-minutes: 30 | ||
name: Minimal Supported Rust Version | ||
runs-on: ubuntu-latest | ||
|
@@ -305,6 +157,7 @@ jobs: | |
command-arguments: "-Dwarnings" | ||
|
||
netsim-integration-tests: | ||
if: "github.event_name != 'pull_request' || ! contains(github.event.pull_request.labels.*.name, 'flaky-test')" | ||
timeout-minutes: 30 | ||
name: Run network simulations/benchmarks | ||
runs-on: [self-hosted, linux, X64] | ||
|
@@ -399,10 +252,6 @@ jobs: | |
tar cvzf report.tar.gz report_prom.txt report_metro.txt report_metro_integration.txt logs/ report/ viz/ | ||
aws s3 cp ./report.tar.gz s3://${{secrets.S3_REPORT_BUCKET}}/$aws_fname --no-progress | ||
link_data='dump{fname="'$aws_fname'",commit="'${{ env.LAST_COMMIT_SHA }}'",branch="'${{ env.HEAD_REF }}'"} 1.0' | ||
link_data=$(printf "%s\n " "$link_data") | ||
curl -X POST -H "Content-Type: text/plain" --data "$link_data" ${{secrets.PROM_ENDPOINT}}/metrics/job/netsim/instance/${instance} | ||
- name: Echo metrics | ||
run: | | ||
cd ../chuck/netsim | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Run all tests, including flaky test. | ||
# | ||
# The default CI workflow ignores flaky tests. This workflow will run | ||
# all tests, including ignored ones. | ||
# | ||
# To use this workflow you can either: | ||
# | ||
# - Label a PR with "flaky-test", the normal CI workflow will not run | ||
# any jobs but the jobs here will be run. Note that to merge the PR | ||
# you'll need to remove the label eventually because the normal CI | ||
# jobs are required by branch protection. | ||
# | ||
# - Manually trigger the workflow, you may choose a branch for this to | ||
# run on. | ||
# | ||
# Additionally this jobs runs once a day on a schedule. | ||
# | ||
# Currently doctests are not run by this workflow. | ||
|
||
name: Flaky CI | ||
|
||
on: | ||
pull_request: | ||
types: [ 'labeled', 'unlabeled', 'opened', 'synchronize', 'reopened' ] | ||
schedule: | ||
# 06:30 UTC every day | ||
- cron: '30 6 * * *' | ||
workflow_dispatch: | ||
inputs: | ||
branch: | ||
description: 'Branch to run on, defaults to main' | ||
required: true | ||
default: 'main' | ||
type: string | ||
|
||
concurrency: | ||
group: flaky-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
tests: | ||
if: "contains(github.event.pull_request.labels.*.name, 'flaky-test') || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule'" | ||
uses: './.github/workflows/tests.yaml' | ||
with: | ||
flaky: true | ||
git-ref: ${{ inputs.branch }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.