From 8d4a2cc7a217e53c7aaabcfab42162be53e0b711 Mon Sep 17 00:00:00 2001 From: Andy Pohl Date: Thu, 16 May 2024 13:20:03 -0500 Subject: [PATCH 1/3] top-level toml for Cargo workspace --- Cargo.toml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 Cargo.toml diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..7ed1fa4 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,8 @@ +[workspace] +members = [ + "src/rust/rust-demultiplex", + "src/rust/rust-umi" +] + +[profile.release] +opt-level = 3 From b6f86495e9a634f2428080c4a4fad151be975cd2 Mon Sep 17 00:00:00 2001 From: Andy Pohl Date: Thu, 16 May 2024 13:25:28 -0500 Subject: [PATCH 2/3] runs rust unit tests --- .github/workflows/rust.yml | 46 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/rust.yml diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml new file mode 100644 index 0000000..3aae4eb --- /dev/null +++ b/.github/workflows/rust.yml @@ -0,0 +1,46 @@ +name: Rust Build/Test + +# The trigger structure here is a little confusing but it specifies to +# run on all pushes, and then subsequent pushes during a PR to the main. +# It skips running after a PR is merged because by then it will have +# already been run on the main branch. + +on: + push: + branches-ignore: + - "main" + paths: + - "src/rust/**/*.rs" + - "Cargo.toml" + - "Cargo.lock" + pull_request: + branches: + - "main" + paths: + - "src/rust/**/*.rs" + - "Cargo.toml" + - "Cargo.lock" +env: + CARGO_TERM_COLOR: always + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest] + steps: + - uses: actions/checkout@v4 + - uses: actions/cache@v4 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + - name: Build + run: cargo build --verbose + - name: Run tests + run: cargo test --verbose From 5a0becf4a6b5ea4f865163e67f6ffd4e4ffa8e5e Mon Sep 17 00:00:00 2001 From: Andy Pohl Date: Thu, 16 May 2024 13:33:13 -0500 Subject: [PATCH 3/3] there are multiple .lock/.toml files --- .github/workflows/rust.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 3aae4eb..9b19c74 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -11,15 +11,15 @@ on: - "main" paths: - "src/rust/**/*.rs" - - "Cargo.toml" - - "Cargo.lock" + - "**/Cargo.toml" + - "**/Cargo.lock" pull_request: branches: - "main" paths: - "src/rust/**/*.rs" - - "Cargo.toml" - - "Cargo.lock" + - "**/Cargo.toml" + - "**/Cargo.lock" env: CARGO_TERM_COLOR: always