Skip to content

Commit c7e0d50

Browse files
authored
Add CI coverage for Windows (#1714)
1 parent 6c9385c commit c7e0d50

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

.github/workflows/ci.yml

+19-8
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,17 @@ jobs:
1212
test:
1313
strategy:
1414
matrix:
15+
# test both stable and beta versions of Rust on ubuntu-latest
16+
os: [ubuntu-latest]
1517
rust: [stable, beta]
16-
runs-on: ubuntu-latest
18+
# test only stable version of Rust on Windows
19+
include:
20+
- rust: stable
21+
os: windows-latest
22+
runs-on: ${{ matrix.os }}
1723
steps:
1824
- name: Free disk space
25+
if: ${{ matrix.os == 'ubuntu-latest'}}
1926
run: |
2027
df -h
2128
sudo rm -rf /usr/local/lib/android
@@ -32,7 +39,7 @@ jobs:
3239
run: rustup set profile minimal
3340
- uses: arduino/setup-protoc@v3
3441
- name: Test
35-
run: ./scripts/test.sh
42+
run: bash ./scripts/test.sh
3643
lint:
3744
runs-on: ubuntu-latest
3845
steps:
@@ -48,12 +55,12 @@ jobs:
4855
command: fmt
4956
args: --all -- --check
5057
- name: Lint
51-
run: ./scripts/lint.sh
58+
run: bash ./scripts/lint.sh
5259
external-types:
5360
strategy:
5461
matrix:
5562
example: [opentelemetry, opentelemetry-sdk, opentelemetry-otlp, opentelemetry-zipkin]
56-
runs-on: ubuntu-latest
63+
runs-on: ubuntu-latest # TODO: Check if this could be covered for Windows. The step used currently fails on Windows.
5764
steps:
5865
- uses: actions/checkout@v4
5966
- uses: dtolnay/rust-toolchain@nightly
@@ -68,8 +75,9 @@ jobs:
6875
non-default-examples:
6976
strategy:
7077
matrix:
78+
os: [ windows-latest, ubuntu-latest ]
7179
example: [opentelemetry-otlp/examples/basic-otlp]
72-
runs-on: ubuntu-latest
80+
runs-on: ${{ matrix.os }}
7381
steps:
7482
- uses: actions/checkout@v4
7583
with:
@@ -83,21 +91,24 @@ jobs:
8391
cd ${{ matrix.example }}
8492
cargo build --verbose
8593
msrv:
86-
runs-on: ubuntu-latest
94+
strategy:
95+
matrix:
96+
os: [ windows-latest, ubuntu-latest ]
97+
runs-on: ${{ matrix.os }}
8798
steps:
8899
- uses: actions/checkout@v4
89100
with:
90101
submodules: true
91102
- uses: dtolnay/rust-toolchain@1.65.0
92103
- name: Patch dependencies versions # some dependencies bump MSRV without major version bump
93-
run: ./scripts/patch_dependencies.sh
104+
run: bash ./scripts/patch_dependencies.sh
94105
- name: Run tests
95106
run: cargo --version &&
96107
cargo test --manifest-path=opentelemetry/Cargo.toml --features trace,metrics,testing &&
97108
cargo test --manifest-path=opentelemetry-jaeger/Cargo.toml --features rt-tokio &&
98109
cargo test --manifest-path=opentelemetry-zipkin/Cargo.toml
99110
cargo-deny:
100-
runs-on: ubuntu-latest
111+
runs-on: ubuntu-latest # This uses the step `EmbarkStudios/cargo-deny-action@v1` which is only supported on Linux
101112
continue-on-error: true # Prevent sudden announcement of a new advisory from failing ci
102113
steps:
103114
- uses: actions/checkout@v4

0 commit comments

Comments
 (0)