From f623284c71be26952ca00900f95c3779dc70a917 Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Wed, 6 Oct 2021 23:12:42 +0100 Subject: [PATCH] ignore protobuf-example in ci --- .github/workflows/linux.yml | 32 ++++++++++------------ Cargo.lock | 17 ++++++++++-- database_interactions/sqlx_todo/.gitignore | 2 +- database_interactions/sqlx_todo/Cargo.toml | 2 +- other/protobuf/Cargo.toml | 10 +++---- other/protobuf/src/main.rs | 4 +-- 6 files changed, 39 insertions(+), 28 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 617364e..fa6a584 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -15,28 +15,27 @@ jobs: strategy: fail-fast: false matrix: - version: ["stable", "nightly"] + version: ['stable', 'nightly'] + + env: + # included in example of redis, not clear its purpose + CI: true steps: - uses: actions/checkout@v2 - - name: cache cargo artifacts - uses: actions/cache@v2 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - ./target/debug - key: cargo-linux-${{ matrix.version }}-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - cargo-linux-${{ matrix.version }}- - - uses: actions-rs/toolchain@v1 with: profile: minimal toolchain: ${{ matrix.version }} override: true + - name: Generate Cargo.lock + uses: actions-rs/cargo@v1 + with: { command: generate-lockfile } + - name: Cache Dependencies + uses: Swatinem/rust-cache@v1.2.0 + - name: create test db for sqlx run: | sudo apt-get update && sudo apt-get install sqlite3 @@ -50,7 +49,8 @@ jobs: timeout-minutes: 30 with: command: check - args: --workspace --bins --examples --tests + # TODO: remove exclude protobuf-example when upgraded; currently fails on nightly + args: --workspace --bins --examples --tests --exclude protobuf-example - name: start redis uses: supercharge/redis-github-action@1.1.0 @@ -67,9 +67,7 @@ jobs: - name: cargo test uses: actions-rs/cargo@v1 timeout-minutes: 30 - env: - # included in example of redis, not clear its purpose - CI: true with: command: test - args: --workspace --all-features --no-fail-fast -- --nocapture + # TODO: remove exclude protobuf-example when upgraded; currently fails on nightly + args: --workspace --all-features --no-fail-fast --exclude protobuf-example -- --nocapture diff --git a/Cargo.lock b/Cargo.lock index b2664be..73917c3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -384,7 +384,7 @@ version = "0.5.0-beta.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "36b95ce0d76d1aa2f98b681702807475ade0f99bd4552546a6843a966d42ea3d" dependencies = [ - "bytestring 0.1.5", + "bytestring 1.0.0", "firestorm", "http", "log", @@ -2502,6 +2502,19 @@ dependencies = [ "termcolor", ] +[[package]] +name = "env_logger" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b2cf0344971ee6c64c31be0d530793fba457d322dfec2810c453d0ef228f9c3" +dependencies = [ + "atty", + "humantime 2.0.1", + "log", + "regex", + "termcolor", +] + [[package]] name = "error-chain" version = "0.12.4" @@ -4624,7 +4637,7 @@ dependencies = [ "actix-protobuf", "actix-web 3.3.1", "bytes 0.5.6", - "env_logger 0.7.1", + "env_logger 0.9.0", "prost", "prost-derive", ] diff --git a/database_interactions/sqlx_todo/.gitignore b/database_interactions/sqlx_todo/.gitignore index ef82c96..348583b 100644 --- a/database_interactions/sqlx_todo/.gitignore +++ b/database_interactions/sqlx_todo/.gitignore @@ -1,3 +1,3 @@ /target .env -test.db +test.db* diff --git a/database_interactions/sqlx_todo/Cargo.toml b/database_interactions/sqlx_todo/Cargo.toml index b256311..d5baefb 100644 --- a/database_interactions/sqlx_todo/Cargo.toml +++ b/database_interactions/sqlx_todo/Cargo.toml @@ -11,7 +11,7 @@ actix-web = "3" listenfd = "0.3.3" serde = "1.0.106" serde_json = "1.0.51" -sqlx = { version = "0.3", features = [ "sqlite" ] } +sqlx = { version = "0.3", features = ["sqlite"] } dotenv = "0.15.0" env_logger = "0.7.1" log = "0.4.8" diff --git a/other/protobuf/Cargo.toml b/other/protobuf/Cargo.toml index 4550a36..eec02b4 100644 --- a/other/protobuf/Cargo.toml +++ b/other/protobuf/Cargo.toml @@ -5,11 +5,11 @@ authors = ["kingxsp , Yuki Okushi edition = "2018" [dependencies] -bytes = "0.5.4" -env_logger = "0.7.1" -prost = "0.6.1" -prost-derive = "0.6.1" - actix = "0.10" actix-protobuf = "0.6" actix-web = "3" + +bytes = "0.5.4" +env_logger = "0.9" +prost = "0.6" +prost-derive = "0.6" diff --git a/other/protobuf/src/main.rs b/other/protobuf/src/main.rs index fdd7c8a..e8cc79f 100644 --- a/other/protobuf/src/main.rs +++ b/other/protobuf/src/main.rs @@ -1,8 +1,8 @@ #[macro_use] extern crate prost_derive; -use actix_protobuf::*; -use actix_web::*; +use actix_protobuf::{ProtoBuf, ProtoBufResponseBuilder as _}; +use actix_web::{middleware, web, App, HttpResponse, HttpServer, Result}; #[derive(Clone, PartialEq, Message)] pub struct MyObj {