From 41ba214ab206ede2a4800b30a8a3e16468743a0e Mon Sep 17 00:00:00 2001 From: Thomas Forbes Date: Tue, 18 Jun 2024 15:27:00 +0100 Subject: [PATCH] Try this --- .github/workflows/test.yaml | 37 +++++++++++++++++++++++++++++++++++++ Cargo.toml | 3 +++ Dockerfile | 2 ++ 3 files changed, 42 insertions(+) create mode 100644 .github/workflows/test.yaml diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..6e04b73 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,37 @@ +name: Integration test +on: [push] + +jobs: + integration-test: + name: cargo build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@v2 + with: + key: "test" + + - uses: hoverkraft-tech/compose-action@v0.0.0 + + - name: Seed ES + run: cargo run -p seed-es-data http://localhost:9201 test-index + + - name: Seed OS + run: cargo run -p seed-es-data http://localhost:9202 test-index + + - name: Dump ES + run: | + cargo run http://localhost:9201 --index=test-index --batches-per-file=5 --batch-size=5000 s3://es-dump/es/ --env-file=test.env --concurrency=10 + + - name: Dump OS + run: | + cargo run http://localhost:9202 --index=test-index --batches-per-file=5 --batch-size=5000 s3://es-dump/es/ --env-file=test.env --concurrency=10 + +# - run: cargo build --profile=release-lto +# - name: Upload build artifacts +# uses: actions/upload-artifact@v4 +# with: +# name: ${{ matrix.platform }} +# path: target/release-lto/esdump-rs* +# retention-days: 1 diff --git a/Cargo.toml b/Cargo.toml index 8510f4d..4225842 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -35,6 +35,9 @@ log = "0.4.21" byte-unit = { version = "5.1.4", features = ["serde"] } clap-num = "1.1.1" +[profile.test] +opt-level = 1 + [profile.release-lto] inherits = "release" lto = true diff --git a/Dockerfile b/Dockerfile index f92bbd2..3a283af 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,7 @@ FROM rust:1-buster AS builder +RUN apt-get update && apt-get install cmake -y + WORKDIR /usr/src/ COPY . .