From df356902e37a2614d4321219621c5e1dca65a4bf Mon Sep 17 00:00:00 2001 From: Utkarsh Umesan Pillai <66651184+utpilla@users.noreply.github.com> Date: Sat, 4 May 2024 13:50:21 -0700 Subject: [PATCH 1/6] Add CI for Windows --- .github/workflows/ci.yml | 43 +++++++++++++++++++++++++++++----------- 1 file changed, 31 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c2853fa3f9..aa644d3c6d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,9 +13,11 @@ jobs: strategy: matrix: rust: [stable, beta] - runs-on: ubuntu-latest + os: [ windows-latest, ubuntu-latest ] + runs-on: ${{ matrix.os }} steps: - name: Free disk space + if: ${{ matrix.os == 'ubuntu-latest'}} run: | df -h sudo rm -rf /usr/local/lib/android @@ -32,9 +34,12 @@ jobs: run: rustup set profile minimal - uses: arduino/setup-protoc@v3 - name: Test - run: ./scripts/test.sh + run: bash ./scripts/test.sh lint: - runs-on: ubuntu-latest + strategy: + matrix: + os: [ windows-latest, ubuntu-latest ] + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 with: @@ -48,12 +53,13 @@ jobs: command: fmt args: --all -- --check - name: Lint - run: ./scripts/lint.sh + run: bash ./scripts/lint.sh external-types: strategy: matrix: + os: [ windows-latest, ubuntu-latest ] example: [opentelemetry, opentelemetry-sdk, opentelemetry-otlp, opentelemetry-zipkin] - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@nightly @@ -68,8 +74,9 @@ jobs: non-default-examples: strategy: matrix: + os: [ windows-latest, ubuntu-latest ] example: [opentelemetry-otlp/examples/basic-otlp] - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 with: @@ -83,21 +90,27 @@ jobs: cd ${{ matrix.example }} cargo build --verbose msrv: - runs-on: ubuntu-latest + strategy: + matrix: + os: [ windows-latest, ubuntu-latest ] + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 with: submodules: true - uses: dtolnay/rust-toolchain@1.65.0 - name: Patch dependencies versions # some dependencies bump MSRV without major version bump - run: ./scripts/patch_dependencies.sh + run: bash ./scripts/patch_dependencies.sh - name: Run tests run: cargo --version && cargo test --manifest-path=opentelemetry/Cargo.toml --features trace,metrics,testing && cargo test --manifest-path=opentelemetry-jaeger/Cargo.toml --features rt-tokio && cargo test --manifest-path=opentelemetry-zipkin/Cargo.toml cargo-deny: - runs-on: ubuntu-latest + strategy: + matrix: + os: [ windows-latest, ubuntu-latest ] + runs-on: ${{ matrix.os }} continue-on-error: true # Prevent sudden announcement of a new advisory from failing ci steps: - uses: actions/checkout@v4 @@ -105,8 +118,11 @@ jobs: with: command: check advisories docs: + strategy: + matrix: + os: [ windows-latest, ubuntu-latest ] continue-on-error: true - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@nightly @@ -120,7 +136,10 @@ jobs: RUSTDOCFLAGS: -Dwarnings coverage: continue-on-error: true - runs-on: ubuntu-latest + strategy: + matrix: + os: [ windows-latest, ubuntu-latest ] + runs-on: ${{ matrix.os }} if: ${{ ! contains(github.event.pull_request.labels.*.name, 'dependencies') }} steps: - uses: actions/checkout@v4 @@ -141,4 +160,4 @@ jobs: - name: Upload to codecov.io uses: codecov/codecov-action@v3 with: - fail_ci_if_error: false + fail_ci_if_error: false \ No newline at end of file From 5f76ec19c63dff633ecdd39dfbbbe97f62b4afba Mon Sep 17 00:00:00 2001 From: Utkarsh Umesan Pillai <66651184+utpilla@users.noreply.github.com> Date: Mon, 6 May 2024 10:49:33 -0700 Subject: [PATCH 2/6] Add new line --- .github/workflows/ci.yml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aa644d3c6d..746d2945cd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,9 +57,8 @@ jobs: external-types: strategy: matrix: - os: [ windows-latest, ubuntu-latest ] example: [opentelemetry, opentelemetry-sdk, opentelemetry-otlp, opentelemetry-zipkin] - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest # TODO: Check if this could be covered on Windows. The step used currently fails on Windows. steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@nightly @@ -107,10 +106,7 @@ jobs: cargo test --manifest-path=opentelemetry-jaeger/Cargo.toml --features rt-tokio && cargo test --manifest-path=opentelemetry-zipkin/Cargo.toml cargo-deny: - strategy: - matrix: - os: [ windows-latest, ubuntu-latest ] - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest # This is only supported on Linux continue-on-error: true # Prevent sudden announcement of a new advisory from failing ci steps: - uses: actions/checkout@v4 @@ -160,4 +156,5 @@ jobs: - name: Upload to codecov.io uses: codecov/codecov-action@v3 with: - fail_ci_if_error: false \ No newline at end of file + fail_ci_if_error: false + \ No newline at end of file From d21fa3098f82332ee594efd65b4b2655a2b0f3e3 Mon Sep 17 00:00:00 2001 From: Utkarsh Umesan Pillai <66651184+utpilla@users.noreply.github.com> Date: Mon, 6 May 2024 10:57:53 -0700 Subject: [PATCH 3/6] Fix --- .github/workflows/ci.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 746d2945cd..a1618d0733 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -58,7 +58,7 @@ jobs: strategy: matrix: example: [opentelemetry, opentelemetry-sdk, opentelemetry-otlp, opentelemetry-zipkin] - runs-on: ubuntu-latest # TODO: Check if this could be covered on Windows. The step used currently fails on Windows. + runs-on: ubuntu-latest # TODO: Check if this could be covered for Windows. The step used currently fails on Windows. steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@nightly @@ -106,7 +106,7 @@ jobs: cargo test --manifest-path=opentelemetry-jaeger/Cargo.toml --features rt-tokio && cargo test --manifest-path=opentelemetry-zipkin/Cargo.toml cargo-deny: - runs-on: ubuntu-latest # This is only supported on Linux + runs-on: ubuntu-latest # This uses the step `EmbarkStudios/cargo-deny-action@v1` which is only supported on Linux continue-on-error: true # Prevent sudden announcement of a new advisory from failing ci steps: - uses: actions/checkout@v4 @@ -157,4 +157,3 @@ jobs: uses: codecov/codecov-action@v3 with: fail_ci_if_error: false - \ No newline at end of file From c96b14ff9ff8de49d393e6f810af35178b214c71 Mon Sep 17 00:00:00 2001 From: Utkarsh Umesan Pillai <66651184+utpilla@users.noreply.github.com> Date: Mon, 6 May 2024 12:58:06 -0700 Subject: [PATCH 4/6] Run dos and lint only on Linux --- .github/workflows/ci.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a1618d0733..d29fa346fe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,10 +36,7 @@ jobs: - name: Test run: bash ./scripts/test.sh lint: - strategy: - matrix: - os: [ windows-latest, ubuntu-latest ] - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: @@ -114,11 +111,8 @@ jobs: with: command: check advisories docs: - strategy: - matrix: - os: [ windows-latest, ubuntu-latest ] continue-on-error: true - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@nightly From f02f52603e1bef993d0cb6a5252012b0b95176f5 Mon Sep 17 00:00:00 2001 From: Utkarsh Umesan Pillai <66651184+utpilla@users.noreply.github.com> Date: Mon, 6 May 2024 16:50:39 -0700 Subject: [PATCH 5/6] Use only stable Rust on Windows --- .github/workflows/ci.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d29fa346fe..9bbac24b77 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,8 +12,13 @@ jobs: test: strategy: matrix: + # test all Rust versions on ubuntu-latest + os: [ubuntu-latest] rust: [stable, beta] - os: [ windows-latest, ubuntu-latest ] + # test stable Rust on Windows + include: + - rust: stable + os: windows-latest runs-on: ${{ matrix.os }} steps: - name: Free disk space @@ -126,10 +131,7 @@ jobs: RUSTDOCFLAGS: -Dwarnings coverage: continue-on-error: true - strategy: - matrix: - os: [ windows-latest, ubuntu-latest ] - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest if: ${{ ! contains(github.event.pull_request.labels.*.name, 'dependencies') }} steps: - uses: actions/checkout@v4 From d9856f81f3453da11b70ee5e1c674daec9e47194 Mon Sep 17 00:00:00 2001 From: Utkarsh Umesan Pillai <66651184+utpilla@users.noreply.github.com> Date: Mon, 6 May 2024 16:53:01 -0700 Subject: [PATCH 6/6] Update comments --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9bbac24b77..bae1251f9e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,10 +12,10 @@ jobs: test: strategy: matrix: - # test all Rust versions on ubuntu-latest + # test both stable and beta versions of Rust on ubuntu-latest os: [ubuntu-latest] rust: [stable, beta] - # test stable Rust on Windows + # test only stable version of Rust on Windows include: - rust: stable os: windows-latest