|
| 1 | +# Unless explicitly stated otherwise all files in this repository are licensed under the MIT License. |
| 2 | +# |
| 3 | +# This product includes software developed at Datadog (https://www.datadoghq.com/) |
| 4 | +# Copyright 2026 Datadog, Inc. |
1 | 5 |
|
2 | 6 | name: CI |
3 | 7 | on: |
4 | 8 | push: |
5 | 9 | branches: [main] |
6 | 10 | pull_request: |
| 11 | + workflow_dispatch: |
7 | 12 | permissions: |
8 | 13 | contents: read |
9 | 14 |
|
10 | 15 | env: |
11 | 16 | CARGO_TERM_COLOR: always |
12 | 17 |
|
13 | 18 | jobs: |
| 19 | + license: |
| 20 | + name: License Inventory |
| 21 | + runs-on: ubuntu-latest |
| 22 | + steps: |
| 23 | + - name: Check out repository |
| 24 | + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 |
| 25 | + - name: Install toolchain |
| 26 | + uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # v1 |
| 27 | + with: |
| 28 | + toolchain: stable |
| 29 | + - name: Cache build artifacts |
| 30 | + uses: Swatinem/rust-cache@42dc69e1aa15d09112580998cf2ef0119e2e91ae # v2 |
| 31 | + - name: Check third-party license inventory |
| 32 | + run: make check-licenses |
| 33 | + |
14 | 34 | test: |
15 | 35 | name: Test |
16 | | - runs-on: windows-latest |
| 36 | + runs-on: windows-2022 |
17 | 37 | steps: |
18 | 38 | - name: Check out repository |
19 | | - uses: actions/checkout@v4 |
| 39 | + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 |
20 | 40 | - name: Install toolchain |
21 | | - uses: dtolnay/rust-toolchain@v1 |
| 41 | + uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # v1 |
22 | 42 | with: |
23 | 43 | toolchain: stable |
24 | 44 | - name: Cache build artifacts |
25 | | - uses: Swatinem/rust-cache@v2 |
| 45 | + uses: Swatinem/rust-cache@42dc69e1aa15d09112580998cf2ef0119e2e91ae # v2 |
26 | 46 | - name: cargo test |
27 | 47 | run: cargo test |
28 | 48 | # https://github.com/rust-lang/cargo/issues/6669 |
29 | 49 | - name: cargo test --doc |
30 | 50 | run: cargo test --doc |
| 51 | + |
31 | 52 | lint: |
32 | 53 | name: Lint |
33 | | - runs-on: windows-latest |
| 54 | + runs-on: windows-2022 |
34 | 55 | steps: |
35 | 56 | - name: Check out repository |
36 | | - uses: actions/checkout@v4 |
| 57 | + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 |
37 | 58 | - name: Install toolchain |
38 | | - uses: dtolnay/rust-toolchain@v1 |
| 59 | + uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # v1 |
39 | 60 | with: |
40 | 61 | toolchain: stable |
41 | 62 | components: rustfmt, clippy |
42 | 63 | - name: Cache build artifacts |
43 | | - uses: Swatinem/rust-cache@v2 |
| 64 | + uses: Swatinem/rust-cache@42dc69e1aa15d09112580998cf2ef0119e2e91ae # v2 |
44 | 65 | - name: cargo fmt (check) |
45 | 66 | run: cargo fmt -- --check -l |
46 | 67 | - name: cargo clippy (warnings) |
47 | 68 | run: cargo clippy --all-targets -- -D warnings |
48 | 69 | - name: cargo clippy --no-default-features (warnings) |
49 | 70 | run: cargo clippy --no-default-features --all-targets -- -D warnings |
50 | 71 |
|
51 | | - |
52 | 72 | coverage: |
53 | 73 | name: Coverage |
54 | | - runs-on: windows-latest |
| 74 | + runs-on: windows-2022 |
55 | 75 | steps: |
56 | 76 | - name: Check out repository |
57 | | - uses: actions/checkout@v4 |
| 77 | + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 |
58 | 78 | - name: Install toolchain |
59 | | - uses: dtolnay/rust-toolchain@v1 |
| 79 | + uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # v1 |
60 | 80 | with: |
61 | 81 | toolchain: stable |
62 | 82 | components: llvm-tools |
63 | 83 | - name: Cache build artifacts |
64 | | - uses: Swatinem/rust-cache@v2 |
| 84 | + uses: Swatinem/rust-cache@42dc69e1aa15d09112580998cf2ef0119e2e91ae # v2 |
65 | 85 | - name: Install cargo-llvm-cov |
66 | | - uses: taiki-e/install-action@cargo-llvm-cov |
| 86 | + uses: taiki-e/install-action@50570a4fd0cb7e583e6a512c02bffb9ade28d868 # cargo-llvm-cov |
67 | 87 | - name: Generate coverage |
68 | 88 | run: cargo llvm-cov --lcov --output-path lcov.info |
69 | 89 | - name: Report to codecov.io |
70 | | - uses: codecov/codecov-action@v5 |
| 90 | + uses: codecov/codecov-action@04b047e8bb82a0c002c8312c1c880fbc6a999d45 # v5 |
71 | 91 | with: |
72 | 92 | files: lcov.info |
73 | 93 | token: ${{ secrets.CODECOV_TOKEN }} |
|
0 commit comments