|
| 1 | +name: CI |
| 2 | +env: |
| 3 | + CI: true |
| 4 | +on: |
| 5 | + pull_request: |
| 6 | + push: |
| 7 | + branches: |
| 8 | + - main |
| 9 | + paths-ignore: |
| 10 | + - '**.md' |
| 11 | +jobs: |
| 12 | + test: |
| 13 | + strategy: |
| 14 | + matrix: |
| 15 | + rust: [stable, beta] |
| 16 | + runs-on: ubuntu-latest |
| 17 | + steps: |
| 18 | + - name: Free disk space |
| 19 | + run: | |
| 20 | + df -h |
| 21 | + sudo rm -rf /usr/local/lib/android |
| 22 | + sudo rm -rf /usr/share/dotnet |
| 23 | + df -h |
| 24 | + - uses: actions/checkout@v1 |
| 25 | + with: |
| 26 | + submodules: true |
| 27 | + - uses: actions-rs/toolchain@v1 |
| 28 | + with: |
| 29 | + toolchain: ${{ matrix.rust }} |
| 30 | + components: rustfmt |
| 31 | + profile: minimal |
| 32 | + - uses: arduino/setup-protoc@v1 |
| 33 | + - name: Test |
| 34 | + run: ./scripts/test.sh |
| 35 | + lint: |
| 36 | + runs-on: ubuntu-latest |
| 37 | + steps: |
| 38 | + - uses: actions/checkout@v1 |
| 39 | + with: |
| 40 | + submodules: true |
| 41 | + - uses: actions-rs/toolchain@v1 |
| 42 | + with: |
| 43 | + toolchain: stable |
| 44 | + components: rustfmt |
| 45 | + profile: minimal |
| 46 | + - uses: arduino/setup-protoc@v1 |
| 47 | + - uses: actions-rs/cargo@v1 |
| 48 | + with: |
| 49 | + command: fmt |
| 50 | + args: --all -- --check |
| 51 | + - name: Lint |
| 52 | + run: ./scripts/lint.sh |
| 53 | +# TODO: re-add this test |
| 54 | +# msrv: |
| 55 | +# runs-on: ubuntu-latest |
| 56 | +# steps: |
| 57 | +# - uses: actions/checkout@v1 |
| 58 | +# with: |
| 59 | +# submodules: true |
| 60 | +# - uses: actions-rs/toolchain@v1 |
| 61 | +# with: |
| 62 | +# profile: minimal |
| 63 | +# toolchain: 1.65.0 |
| 64 | +# override: true |
| 65 | +# - name: Patch dependencies versions # some dependencies bump MSRV without major version bump |
| 66 | +# run: ./scripts/patch_dependencies.sh |
| 67 | +# - name: Run tests |
| 68 | +# run: cargo --version && |
| 69 | +# cargo test --manifest-path=opentelemetry/Cargo.toml --features trace,metrics,testing && |
| 70 | +# cargo test --manifest-path=opentelemetry-jaeger/Cargo.toml --features rt-tokio && |
| 71 | +# cargo test --manifest-path=opentelemetry-zipkin/Cargo.toml |
| 72 | + cargo-deny: |
| 73 | + runs-on: ubuntu-latest |
| 74 | + continue-on-error: true # Prevent sudden announcement of a new advisory from failing ci |
| 75 | + steps: |
| 76 | + - uses: actions/checkout@v2 |
| 77 | + - uses: EmbarkStudios/cargo-deny-action@v1 |
| 78 | + with: |
| 79 | + command: check advisories |
| 80 | + docs: |
| 81 | + continue-on-error: true |
| 82 | + runs-on: ubuntu-latest |
| 83 | + steps: |
| 84 | + - uses: actions/checkout@v2 |
| 85 | + - uses: actions-rs/toolchain@v1 |
| 86 | + with: |
| 87 | + toolchain: nightly |
| 88 | + components: rustfmt |
| 89 | + override: true |
| 90 | + - uses: arduino/setup-protoc@v1 |
| 91 | + - name: doc |
| 92 | + run: cargo doc --no-deps --all-features |
| 93 | + env: |
| 94 | + CARGO_INCREMENTAL: '0' |
| 95 | + RUSTDOCFLAGS: -Dwarnings |
| 96 | + coverage: |
| 97 | + continue-on-error: true |
| 98 | + runs-on: ubuntu-latest |
| 99 | + steps: |
| 100 | + - uses: actions/checkout@v3 |
| 101 | + with: |
| 102 | + submodules: true |
| 103 | + - uses: actions-rs/toolchain@v1 |
| 104 | + with: |
| 105 | + toolchain: stable |
| 106 | + components: rustfmt,llvm-tools-preview |
| 107 | + override: true |
| 108 | + - uses: arduino/setup-protoc@v1 |
| 109 | + - name: cargo install cargo-llvm-cov |
| 110 | + uses: taiki-e/install-action@cargo-llvm-cov |
| 111 | + - name: cargo generate-lockfile |
| 112 | + if: hashFiles('Cargo.lock') == '' |
| 113 | + run: cargo generate-lockfile |
| 114 | + - name: cargo llvm-cov |
| 115 | + run: cargo llvm-cov --locked --all-features --workspace --lcov --output-path lcov.info |
| 116 | + - name: Upload to codecov.io |
| 117 | + uses: codecov/codecov-action@v3 |
| 118 | + with: |
| 119 | + fail_ci_if_error: true |
0 commit comments