diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 1fbd7ab..911c6c2 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -8,33 +8,33 @@ name: check jobs: check: - runs-on: ubuntu-latest - defaults: - run: - shell: bash strategy: matrix: mq: [standalone, rabbitmq, redis] + ci_image: [ubuntu-latest, macos-latest] include: - mq: rabbitmq docker_image: "rabbitmq:3.8-management" - mq_uri: "amqp://guest:guest@localhost" - mq_api: "http://guest:guest@localhost:15672/api" + mq_uri: "amqp://guest:guest@127.0.0.1" + mq_api: "http://guest:guest@127.0.0.1:15672/api" - mq: redis docker_image: "redis" - mq_uri: "redis://localhost:16379" - services: - mq: - image: ${{ matrix.docker_image }} - ports: - - 5672:5672 # rabbitmq - - 15672:15672 # rabbitmq - - 16379:6379 # redis - redis: # for storage macro - image: redis - ports: - - 6379:6379 + mq_uri: "redis://127.0.0.1:16379" + runs-on: ${{ matrix.ci_image }} + defaults: + run: + shell: bash steps: + - name: Install docker + if: ${{ startsWith(matrix.ci_image, 'macos') }} + run: | + brew install docker + colima start + - name: Start container (mq) + if: ${{ matrix.mq != 'standalone' }} + run: docker run -d -p 5672:5672 -p 15672:15672 -p 16379:6379 ${{ matrix.docker_image }} + - name: Start container (redis) # for storage macro + run: docker run -d -p 6379:6379 redis - name: Checkout uses: actions/checkout@v3 with: @@ -45,12 +45,15 @@ jobs: toolchain: stable components: rustfmt, clippy - name: Check + if: ${{ startsWith(matrix.ci_image, 'ubuntu') }} # skip check in macos because it is slow run: cargo check --release - name: Build run: cargo build --all-targets - name: Format check + if: ${{ startsWith(matrix.ci_image, 'ubuntu') }} run: cargo fmt --all -- --check - name: Clippy test + if: ${{ startsWith(matrix.ci_image, 'ubuntu') }} run: cargo clippy --profile test -- -D warnings -D clippy::dbg_macro - name: Download Server run: bash download-server.sh diff --git a/Cargo.toml b/Cargo.toml index 872129a..e7e030e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "colink" -version = "0.3.1" +version = "0.3.2" edition = "2021" description = "CoLink Rust SDK" license = "MIT" diff --git a/README.md b/README.md index e2e29e8..b01da17 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ CoLink SDK helps both application and protocol developers access the functionali Add this to your Cargo.toml: ```toml [dependencies] -colink = "0.3.1" +colink = "0.3.2" ``` ## Getting Started diff --git a/src/extensions/instant_server.rs b/src/extensions/instant_server.rs index bf26b0f..ff3de6d 100644 --- a/src/extensions/instant_server.rs +++ b/src/extensions/instant_server.rs @@ -48,7 +48,7 @@ impl InstantServer { .arg("bash -c \"$(curl -fsSL https://raw.githubusercontent.com/CoLearn-Dev/colinkctl/main/install_colink.sh)\"") .env("COLINK_INSTALL_SERVER_ONLY", "true") .env("COLINK_INSTALL_SILENT", "true") - .env("COLINK_SERVER_VERSION", "v0.3.1") + .env("COLINK_SERVER_VERSION", "v0.3.2") .status() .unwrap(); } diff --git a/tests/download-server.sh b/tests/download-server.sh index cdb34d8..ce00e99 100755 --- a/tests/download-server.sh +++ b/tests/download-server.sh @@ -2,7 +2,11 @@ set -e rm -rf colink-server mkdir colink-server && cd colink-server -wget https://github.com/CoLearn-Dev/colink-server-dev/releases/download/v0.3.1/colink-server-linux-x86_64.tar.gz -tar -xzf colink-server-linux-x86_64.tar.gz +PACKAGE_NAME="colink-server-linux-x86_64.tar.gz" +if [ "$(uname)" == "Darwin" ]; then + PACKAGE_NAME="colink-server-macos-x86_64.tar.gz" +fi +wget https://github.com/CoLearn-Dev/colink-server-dev/releases/download/v0.3.2/$PACKAGE_NAME +tar -xzf $PACKAGE_NAME touch user_init_config.toml # create an empty user init config to prevent automatically starting protocols when importing users. cd .. diff --git a/tests/test_storage_macro.rs b/tests/test_storage_macro.rs index c1db619..703dd96 100644 --- a/tests/test_storage_macro.rs +++ b/tests/test_storage_macro.rs @@ -19,7 +19,7 @@ async fn test_storage_macro_redis() -> Result<(), Box