-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
1,369 additions
and
944 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
name: tests | ||
|
||
on: | ||
pull_request: # trigger on pull requests | ||
push: | ||
branches: # array of glob patterns matching against refs/heads. Optional; defaults to all | ||
- main | ||
|
||
|
||
jobs: | ||
test: | ||
strategy: | ||
matrix: | ||
server: | ||
- 7.1.1 | ||
- 7.0.3 | ||
platform: | ||
- ubuntu-20.04 | ||
|
||
runs-on: ${{ matrix.platform }} | ||
services: | ||
couchbase: | ||
image: couchbase:enterprise-${{ matrix.server }} | ||
ports: | ||
- 8091-8096:8091-8096 | ||
- 18091-18096:18091-18096 | ||
- 11210:11210 | ||
- 11207:11207 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
components: clippy | ||
- uses: Swatinem/rust-cache@v2 | ||
with: | ||
key: "v1" | ||
cache-on-failure: "true" | ||
|
||
- name: Install cbdinocluster | ||
run: | | ||
mkdir -p "$HOME/bin" | ||
wget -nv -O $HOME/bin/cbdinocluster https://github.com/couchbaselabs/cbdinocluster/releases/download/v0.0.41/cbdinocluster-linux-amd64 | ||
chmod +x $HOME/bin/cbdinocluster | ||
echo "$HOME/bin" >> $GITHUB_PATH | ||
- name: Initialize cbdinocluster | ||
run: | | ||
cbdinocluster -v init --auto --capella-endpoint https://api.dev.nonprod-project-avengers.com —capella-user [email protected] —capella-pass Password123! --capella-oid 6af08c0a-8cab-4c1c-b257-b521575c16d0 --capella-provider aws --capella-aws-region us-east-1 | ||
- name: Start couchbase cluster | ||
run: | | ||
CBDC_ID=$(cbd allocate simple:7.2 --deployer cloud -v) | ||
cbdinocluster -v buckets add ${CBDC_ID} default --ram-quota-mb=100 --flush-enabled=true --num-replicas=2 | ||
cbdinocluster allow-list add ${CBDC_ID} 0.0.0.0/0 | ||
cbdinocluster users add ${CBDC_ID} Administrator --can-read --can-write --password Password123! | ||
CBDC_CONNSTR=$(cbdinocluster connstr $CBDC_ID) | ||
echo "CBDC_CONNSTR=$CBDC_CONNSTR" >> "$GITHUB_ENV" | ||
- name: Test | ||
uses: actions-rs/cargo@v1 | ||
env: | ||
CONN_STRING: ${{ env.CBDC_CONNSTR }} | ||
PASSWORD: Password123! | ||
CBSH_LOG: cbsh=trace | ||
DATA_TIMEOUT: "30s" | ||
with: | ||
command: test | ||
args: --features Capella --quiet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ name: CI | |
on: | ||
pull_request: # trigger on pull requests | ||
push: | ||
branches: # array of glob patterns matching against refs/heads. Optional; defaults to all | ||
branches: # array of glob patterns matching against refs/heads. Optional; defaults to all | ||
- main | ||
|
||
env: | ||
|
@@ -24,7 +24,7 @@ jobs: | |
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
target: [x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu, x86_64-apple-darwin, aarch64-apple-darwin, x86_64-pc-windows-msvc] | ||
target: [ x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu, x86_64-apple-darwin, aarch64-apple-darwin, x86_64-pc-windows-msvc ] | ||
include: | ||
- target: x86_64-unknown-linux-gnu | ||
os: ubuntu-22.04 | ||
|
@@ -38,86 +38,87 @@ jobs: | |
os: windows-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Update Rust Toolchain Target | ||
run: | | ||
echo "targets = ['${{matrix.target}}']" >> rust-toolchain.toml | ||
- name: Setup Rust toolchain and cache | ||
uses: actions-rust-lang/[email protected] | ||
|
||
- name: Install aarch64-linux gcc | ||
run: sudo apt-get update && sudo apt-get install gcc-aarch64-linux-gnu -y | ||
if: matrix.target == 'aarch64-unknown-linux-gnu' | ||
|
||
- name: Build | ||
uses: actions-rs/cargo@v1 | ||
env: | ||
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: 'aarch64-linux-gnu-gcc' | ||
with: | ||
command: build | ||
args: --verbose --target ${{ matrix.target }} --features static-link-openssl | ||
if: matrix.os == 'ubuntu-22.04' | ||
|
||
- name: Build | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: build | ||
args: --verbose --target ${{ matrix.target }} | ||
if: matrix.os == 'macos-latest' | ||
|
||
- name: Build | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: build | ||
# We build windows as a release build as debug builds are stack overflowing on startup. | ||
args: --verbose --release --target ${{ matrix.target }} | ||
env: | ||
VCPKGRS_DYNAMIC: 1 | ||
RUSTFLAGS: -Ctarget-feature=+crt-static | ||
if: matrix.os == 'windows-latest' | ||
|
||
- name: Test | ||
uses: actions-rs/cargo@v1 | ||
env: | ||
DATA_TIMEOUT: "15s" | ||
CBSH_LOG: cbsh=trace | ||
RUST_LOG: debug | ||
with: | ||
command: test | ||
args: --bins --quiet | ||
|
||
- name: Create archive for Linux | ||
id: createarchivelinux | ||
run: | | ||
7z a -ttar -so -an ./target/${{ matrix.target }}/debug/${{ env.ARTIFACT_BIN }} ${{ env.ARTIFACT_ADDS }} | 7z a -si ${{ env.ARTIFACT_BIN }}-${{ matrix.target }}.tar.gz | ||
if: matrix.os == 'ubuntu-22.04' | ||
|
||
- name: Install p7zip | ||
# 7Zip not available on MacOS, install p7zip via homebrew. | ||
run: brew install p7zip | ||
if: matrix.os == 'macos-latest' | ||
|
||
- name: Create archive for MacOS | ||
id: createarchivemacos | ||
run: | | ||
7z a -tzip ${{ env.ARTIFACT_BIN }}-${{ matrix.target }}.zip ./target/${{ matrix.target }}/debug/${{ env.ARTIFACT_BIN }} ${{ env.ARTIFACT_ADDS }} | ||
if: matrix.os == 'macos-latest' | ||
|
||
- name: Create archive for Windows | ||
id: createarchivewindows | ||
run: | | ||
choco install 7zip | ||
7z a -tzip ${{ env.ARTIFACT_BIN }}-${{ matrix.target }}.zip ./target/${{ matrix.target }}/release/${{ env.ARTIFACT_BIN_WINDOWS }} ${{ env.ARTIFACT_ADDS }} | ||
if: matrix.os == 'windows-latest' | ||
|
||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ env.ARTIFACT_BIN }}-${{ matrix.target }} | ||
path: ${{ env.ARTIFACT_BIN }}-${{ matrix.target }}* | ||
if-no-files-found: error | ||
- uses: actions/checkout@v3 | ||
- uses: ilammy/setup-nasm@v1 | ||
|
||
- name: Update Rust Toolchain Target | ||
run: | | ||
echo "targets = ['${{matrix.target}}']" >> rust-toolchain.toml | ||
- name: Setup Rust toolchain and cache | ||
uses: actions-rust-lang/[email protected] | ||
|
||
- name: Install aarch64-linux gcc | ||
run: sudo apt-get update && sudo apt-get install gcc-aarch64-linux-gnu -y | ||
if: matrix.target == 'aarch64-unknown-linux-gnu' | ||
|
||
- name: Build | ||
uses: actions-rs/cargo@v1 | ||
env: | ||
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: 'aarch64-linux-gnu-gcc' | ||
with: | ||
command: build | ||
args: --verbose --target ${{ matrix.target }} --features static-link-openssl | ||
if: matrix.os == 'ubuntu-22.04' | ||
|
||
- name: Build | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: build | ||
args: --verbose --target ${{ matrix.target }} | ||
if: matrix.os == 'macos-latest' | ||
|
||
- name: Build | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: build | ||
# We build windows as a release build as debug builds are stack overflowing on startup. | ||
args: --verbose --release --target ${{ matrix.target }} | ||
env: | ||
VCPKGRS_DYNAMIC: 1 | ||
RUSTFLAGS: -Ctarget-feature=+crt-static | ||
if: matrix.os == 'windows-latest' | ||
|
||
- name: Test | ||
uses: actions-rs/cargo@v1 | ||
env: | ||
DATA_TIMEOUT: "15s" | ||
CBSH_LOG: cbsh=trace | ||
RUST_LOG: debug | ||
with: | ||
command: test | ||
args: --bins --quiet | ||
|
||
- name: Create archive for Linux | ||
id: createarchivelinux | ||
run: | | ||
7z a -ttar -so -an ./target/${{ matrix.target }}/debug/${{ env.ARTIFACT_BIN }} ${{ env.ARTIFACT_ADDS }} | 7z a -si ${{ env.ARTIFACT_BIN }}-${{ matrix.target }}.tar.gz | ||
if: matrix.os == 'ubuntu-22.04' | ||
|
||
- name: Install p7zip | ||
# 7Zip not available on MacOS, install p7zip via homebrew. | ||
run: brew install p7zip | ||
if: matrix.os == 'macos-latest' | ||
|
||
- name: Create archive for MacOS | ||
id: createarchivemacos | ||
run: | | ||
7z a -tzip ${{ env.ARTIFACT_BIN }}-${{ matrix.target }}.zip ./target/${{ matrix.target }}/debug/${{ env.ARTIFACT_BIN }} ${{ env.ARTIFACT_ADDS }} | ||
if: matrix.os == 'macos-latest' | ||
|
||
- name: Create archive for Windows | ||
id: createarchivewindows | ||
run: | | ||
choco install 7zip | ||
7z a -tzip ${{ env.ARTIFACT_BIN }}-${{ matrix.target }}.zip ./target/${{ matrix.target }}/release/${{ env.ARTIFACT_BIN_WINDOWS }} ${{ env.ARTIFACT_ADDS }} | ||
if: matrix.os == 'windows-latest' | ||
|
||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ env.ARTIFACT_BIN }}-${{ matrix.target }} | ||
path: ${{ env.ARTIFACT_BIN }}-${{ matrix.target }}* | ||
if-no-files-found: error | ||
|
||
rustfmt: | ||
name: Rustfmt | ||
|
Oops, something went wrong.