diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 07030f520..734cb2eb1 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -16,3 +16,6 @@ trace-protobuf @Datadog/serverless trace-mini-agent @Datadog/serverless trace-utils @Datadog/serverless serverless @Datadog/serverless + +# no default owners +experimental/ \ No newline at end of file diff --git a/.github/workflows/experiments-lint.yml b/.github/workflows/experiments-lint.yml new file mode 100644 index 000000000..d7825cc9c --- /dev/null +++ b/.github/workflows/experiments-lint.yml @@ -0,0 +1,40 @@ +name: Lint experiments +on: + push: + paths: + - 'experimental/**' # Only run action when experiments have changed + +defaults: + run: + working-directory: ./experimental + +env: + CARGO_TERM_COLOR: always + +jobs: + rustfmt: + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v3 + - name: Cache + uses: ./.github/actions/cache + - name: Install latest nightly toolchain and rustfmt + run: rustup update nightly && rustup default nightly && rustup component add rustfmt + clippy: + name: "clippy #${{ matrix.rust_version }}" + strategy: + fail-fast: false + matrix: + rust_version: ["stable"] + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v3 + - name: Cache + uses: ./.github/actions/cache + with: + rust_version: ${{ matrix.rust_version }} + - name: Install ${{ matrix.version }} toolchain and clippy + run: rustup install ${{ matrix.rust_version }} && rustup default ${{ matrix.rust_version }} && rustup component add clippy + - run: cargo clippy --all-targets --all-features -- -D warnings \ No newline at end of file diff --git a/.github/workflows/experiments-test.yml b/.github/workflows/experiments-test.yml new file mode 100644 index 000000000..0d86b2b24 --- /dev/null +++ b/.github/workflows/experiments-test.yml @@ -0,0 +1,42 @@ +name: Test experiments +on: + push: + paths: + - 'experimental/**' # Only run action when experiments have changed + +defaults: + run: + working-directory: ./experimental + +env: + CARGO_TERM_COLOR: always + +jobs: + test: + name: "cargo test --workspace #${{ matrix.platform }} ${{ matrix.rust_version }}" + runs-on: ${{ matrix.platform }} + strategy: + matrix: + platform: [windows-latest, ubuntu-latest, macos-12] + rust_version: [""] + steps: + - name: Checkout sources + uses: actions/checkout@v3 + - name: Cache + uses: ./.github/actions/cache + with: + rust_version: ${{ matrix.rust_version }} + - name: Install Rust ${{ matrix.rust_version }} + if: ${{ matrix.rust_version != '' }} + run: rustup install ${{ matrix.rust_version }} && rustup default ${{ matrix.rust_version }} + - id: rust-version + run: echo "version=$(rustc --version)" >> $GITHUB_OUTPUT + - name: "[${{ steps.rust-version.outputs.version}}] cargo build --workspace --verbose" + run: cargo build --workspace --verbose + - name: "[${{ steps.rust-version.outputs.version}}] cargo test --workspace --verbose" + run: cargo test --workspace --verbose + env: + RUST_BACKTRACE: 1 + + + \ No newline at end of file diff --git a/experimental/README.md b/experimental/README.md new file mode 100644 index 000000000..f8758bef4 --- /dev/null +++ b/experimental/README.md @@ -0,0 +1,26 @@ +# Shared library experiments and POC + +In past a lot of interesting projects have been kept eternally on a branch of libdatadog. + +However this has made collaboration and reuse of code within core of libdatadog harder. + +As a consequences, we've discussed in the past the idea of having a semi-temporary experiments sub project within libdatadog. Where all those not yet-production ready (or meant for production) projects can live, and facilitiate code reuse and better collaboration based on Pull requests. + +## Rules for experiments + +For now *by default* all of the projects withing `experimental` namespace should not be build alongside the full libdatadog crate, to avoid unnecessary increase of build times and the complexity of the libdatadog's CI. + +Experiments are free to add CI configuration as they see fit. They should however prefer to constrain the CI run only to their own folders, e.g. + +``` +name: Experimental CI +on: + push: + paths: + - 'experimental/custom-parsing/**' # Only run action when custom parsing code has changes + +``` + +To simplify the experiment setup - an experimental Cargo workspace will be created - experiments are free to add themselves to the workspace - however its not mandatory. The workspace purpose will mostly be relegeated to CI automations. + +