mirror of
https://github.com/actix/actix-extras.git
synced 2025-02-23 10:53:02 +01:00
* Support otel 0.24 * fix the otel example * Fix examples and last bits * Update examples/custom-root-span/src/main.rs * Update examples/opentelemetry/src/main.rs --------- Co-authored-by: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com>
137 lines
3.2 KiB
YAML
137 lines
3.2 KiB
YAML
name: Rust
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
types: [ opened, synchronize, reopened ]
|
|
branches:
|
|
- main
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
|
|
jobs:
|
|
test_without_otel:
|
|
name: Test
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
# Fail the build if there are warnings
|
|
RUSTFLAGS: "-D warnings"
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Cache dependencies
|
|
id: cache-dependencies
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: |
|
|
~/.cargo/registry
|
|
~/.cargo/git
|
|
target
|
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
profile: minimal
|
|
toolchain: stable
|
|
override: true
|
|
- uses: actions-rs/cargo@v1
|
|
with:
|
|
command: test
|
|
|
|
test_with_otel:
|
|
name: Test
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
# Fail the build if there are warnings
|
|
RUSTFLAGS: "-D warnings"
|
|
strategy:
|
|
matrix:
|
|
otel_version:
|
|
- opentelemetry_0_13
|
|
- opentelemetry_0_14
|
|
- opentelemetry_0_15
|
|
- opentelemetry_0_16
|
|
- opentelemetry_0_17
|
|
- opentelemetry_0_18
|
|
- opentelemetry_0_19
|
|
- opentelemetry_0_20
|
|
- opentelemetry_0_21
|
|
- opentelemetry_0_22
|
|
- opentelemetry_0_23
|
|
- opentelemetry_0_24
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Cache dependencies
|
|
id: cache-dependencies
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: |
|
|
~/.cargo/registry
|
|
~/.cargo/git
|
|
target
|
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
profile: minimal
|
|
toolchain: stable
|
|
override: true
|
|
- uses: actions-rs/cargo@v1
|
|
with:
|
|
command: test
|
|
args: --features ${{ matrix.otel_version }}
|
|
|
|
test_uuid_v7:
|
|
name: Test
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Cache dependencies
|
|
id: cache-dependencies
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: |
|
|
~/.cargo/registry
|
|
~/.cargo/git
|
|
target
|
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
profile: minimal
|
|
toolchain: stable
|
|
override: true
|
|
- uses: actions-rs/cargo@v1
|
|
with:
|
|
command: test
|
|
args: --features uuid_v7
|
|
|
|
fmt:
|
|
name: Rustfmt
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: stable
|
|
override: true
|
|
components: rustfmt
|
|
- uses: actions-rs/cargo@v1
|
|
with:
|
|
command: fmt
|
|
args: --all -- --check
|
|
|
|
clippy:
|
|
name: Clippy
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: stable
|
|
components: clippy
|
|
override: true
|
|
- uses: actions-rs/clippy-check@v1
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
args: -- -D warnings
|