Skip to content

Commit

Permalink
Experiments initial setup
Browse files Browse the repository at this point in the history
  • Loading branch information
pawelchcki committed Sep 22, 2023
1 parent 754acbc commit f5b6aef
Show file tree
Hide file tree
Showing 4 changed files with 111 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ trace-protobuf @Datadog/serverless
trace-mini-agent @Datadog/serverless
trace-utils @Datadog/serverless
serverless @Datadog/serverless

# no default owners
experimental/
40 changes: 40 additions & 0 deletions .github/workflows/experiments-lint.yml
Original file line number Diff line number Diff line change
@@ -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
42 changes: 42 additions & 0 deletions .github/workflows/experiments-test.yml
Original file line number Diff line number Diff line change
@@ -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



26 changes: 26 additions & 0 deletions experimental/README.md
Original file line number Diff line number Diff line change
@@ -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.


0 comments on commit f5b6aef

Please sign in to comment.