Skip to content

Commit

Permalink
test on 1.39
Browse files Browse the repository at this point in the history
  • Loading branch information
adwhit committed May 9, 2020
1 parent 4932d04 commit cace8fa
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 21 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ jobs:
build:
name: Tests
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
- 1.39.0

services:
postgres:
Expand All @@ -26,6 +31,7 @@ jobs:
- name: Install dependencies
run: |
sudo apt install -y libpq-dev libsqlite3-dev libmysqlclient-dev
sleep 5 # sigh mysql takes ages to start
mysql -h 127.0.0.1 --port 3306 -u root -pmysql -e 'CREATE DATABASE IF NOT EXISTS test;'
- name: Checkout
Expand All @@ -34,7 +40,8 @@ jobs:
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: 1.39.0
toolchain: ${{ matrix.rust }}
override: true

- name: Test Postgres
uses: actions-rs/cargo@v1
Expand Down
13 changes: 5 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "diesel-derive-enum"
version = "0.4.4"
version = "1.0.0"
description = "Derive diesel boilerplate for using enums in databases"
authors = ["Alex Whitney <[email protected]>"]
repository = "http://github.com/adwhit/diesel-derive-enum"
Expand All @@ -11,13 +11,10 @@ readme = "README.md"
edition = "2018"

[dependencies]
quote = "1.0.3"
syn = "1.0.16"
heck = "0.3.1"
proc-macro2 = "1.0.9"

[dev-dependencies]
diesel = {version = "1.1", features = ["postgres", "sqlite", "mysql"] }
quote = "1"
syn = "1"
heck = "0.3"
proc-macro2 = "1"

[features]
postgres = []
Expand Down
2 changes: 1 addition & 1 deletion tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["Alex Whitney <[email protected]>"]

[dependencies]
diesel = { version = "1.3.2", features = ["sqlite", "postgres", "mysql"] }
diesel = { version = "1.4", features = ["sqlite", "postgres", "mysql"] }
diesel-derive-enum = { path = "./..", features = ["sqlite", "postgres", "mysql"] }

[features]
Expand Down
9 changes: 6 additions & 3 deletions tests/src/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ pub fn create_table(conn: &PgConnection) {
my_enum my_enum NOT NULL
);
"#,
).unwrap();
)
.unwrap();
}

#[cfg(feature = "mysql")]
Expand All @@ -97,7 +98,8 @@ pub fn create_table(conn: &MysqlConnection) {
my_enum enum('foo', 'bar', 'baz_quxx') NOT NULL
);
"#,
).unwrap();
)
.unwrap();
}

#[cfg(feature = "sqlite")]
Expand All @@ -109,5 +111,6 @@ pub fn create_table(conn: &SqliteConnection) {
my_enum TEXT CHECK(my_enum IN ('foo', 'bar', 'baz_quxx')) NOT NULL
);
"#,
).unwrap();
)
.unwrap();
}
2 changes: 1 addition & 1 deletion tests/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ extern crate diesel;
extern crate diesel_derive_enum;

mod common;
mod pg_array;
mod nullable;
mod pg_array;
mod rename;
mod simple;
11 changes: 7 additions & 4 deletions tests/src/nullable.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use diesel::prelude::*;
use diesel::insert_into;
use diesel::prelude::*;

use common::*;

Expand Down Expand Up @@ -38,7 +38,8 @@ pub fn create_null_table(conn: &PgConnection) {
my_enum my_enum
);
"#,
).unwrap();
)
.unwrap();
}

#[cfg(feature = "mysql")]
Expand All @@ -51,7 +52,8 @@ pub fn create_null_table(conn: &MysqlConnection) {
my_enum enum ('foo', 'bar', 'baz_quxx')
);
"#,
).unwrap();
)
.unwrap();
}

#[cfg(feature = "sqlite")]
Expand All @@ -63,7 +65,8 @@ pub fn create_null_table(conn: &SqliteConnection) {
my_enum TEXT CHECK(my_enum IN ('foo', 'bar', 'baz_quxx'))
);
"#,
).unwrap();
)
.unwrap();
}

#[test]
Expand Down
3 changes: 2 additions & 1 deletion tests/src/pg_array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ pub fn create_table(conn: &PgConnection) {
my_enum_arr my_enum[] NOT NULL
);
"#,
).unwrap();
)
.unwrap();
}

#[test]
Expand Down
1 change: 0 additions & 1 deletion tests/src/rename.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use diesel::prelude::*;


#[cfg(any(feature = "sqlite", feature = "postgres", feature = "mysql"))]
use common::get_connection;

Expand Down
2 changes: 1 addition & 1 deletion tests/src/simple.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use diesel::prelude::*;
use diesel::insert_into;
use diesel::prelude::*;

use common::*;

Expand Down

0 comments on commit cace8fa

Please sign in to comment.