blob: 0185f0447b46c77de913a3e6a56c22524a2592ab [file] [log] [blame]
trigger: ["master"]
pr: ["master"]
jobs:
- template: _build/azure-pipelines-template.yml
parameters:
name: macOS_sqlite
displayName: macOS SQLite
vmImage: macOS-10.15
variables:
BACKEND: sqlite
SQLITE_DATABASE_URL: /tmp/test.db
setup:
- script: |
echo "Skip this step"
- template: _build/azure-pipelines-template.yml
parameters:
name: macOS_postgres
displayName: macOS PostgreSQL
vmImage: macOS-10.15
variables:
BACKEND: postgres
PG_DATABASE_URL: postgres://postgres@localhost/
PG_EXAMPLE_DATABASE_URL: postgres://postgres@localhost/diesel_example
setup:
- script: |
brew update
brew uninstall --ignore-dependencies libpq
brew install postgres
/usr/local/Cellar/postgresql/12.2/bin/initdb --locale=C -E UTF-8 /usr/local/var/postgres
brew services start postgresql
sleep 3
/usr/local/opt/postgres/bin/createuser -s postgres
displayName: Install postgresql
- template: _build/azure-pipelines-template.yml
parameters:
name: macOS_mysql
displayName: macOS MySQL
vmImage: macOS-10.15
variables:
BACKEND: mysql
MYSQL_DATABASE_URL: mysql://root@localhost/diesel_test
MYSQL_EXAMPLE_DATABASE_URL: mysql://root@localhost/diesel_example
MYSQL_UNIT_TEST_DATABASE_URL: mysql://root@localhost/diesel_unit_test
RUST_TEST_THREADS: 1
MYSQLCLIENT_LIB_DIR: /usr/local/Cellar/mysql/8.0.19/lib
setup:
- script: |
brew update &&
brew install mysql &&
brew services start mysql &&
brew services stop mysql;sleep 3;brew services start mysql &&
sleep 2 &&
/usr/local/Cellar/mysql/8.0.19/bin/mysql -e "create database diesel_test; create database diesel_unit_test; grant all on \`diesel_%\`.* to 'root'@'localhost';" -uroot
displayName: Install mysql
- template: _build/azure-pipelines-template.yml
parameters:
name: Linux_sqlite
displayName: Linux SQLite
vmImage: ubuntu-16.04
variables:
BACKEND: sqlite
SQLITE_DATABASE_URL: /tmp/test.db
setup:
- script: |
echo "Skip this step"
- template: _build/azure-pipelines-template.yml
parameters:
name: Linux_postgres
displayName: Linux PostgreSQL
vmImage: ubuntu-16.04
variables:
BACKEND: postgres
PG_DATABASE_URL: postgres://postgres:postgres@localhost/
PG_EXAMPLE_DATABASE_URL: postgres://postgres:postgres@localhost/diesel_example
setup:
- script: |
sudo apt-get update &&
sudo apt-get -y install postgresql libpq-dev &&
echo "host all all 127.0.0.1/32 md5" > sudo tee -a /etc/postgresql/9.5/main/pg_hba.conf &&
sudo service postgresql restart && sleep 3 &&
sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'postgres';" &&
sudo service postgresql restart && sleep 3
displayName: Install postgresql
- template: _build/azure-pipelines-template.yml
parameters:
name: Linux_mysql
displayName: Linux MySQL
vmImage: ubuntu-16.04
variables:
BACKEND: mysql
MYSQL_DATABASE_URL: mysql://root:root@localhost/diesel_test
MYSQL_EXAMPLE_DATABASE_URL: mysql://root:root@localhost/diesel_example
MYSQL_UNIT_TEST_DATABASE_URL: mysql://root:root@localhost/diesel_unit_test
RUST_TEST_THREADS: 1
setup:
- script: |
sudo systemctl start mysql.service &&
mysql -e "create database diesel_test; create database diesel_unit_test; grant all on \`diesel_%\`.* to 'root'@'localhost';" -uroot -proot
displayName: Install mysql
- template: _build/azure-pipelines-template.yml
parameters:
name: Windows_sqlite
displayName: Windows SQLite
vmImage: vs2017-win2016
variables:
BACKEND: sqlite
SQLITE_DATABASE_URL: C:\test.db
SQLITE3_LIB_DIR: C:\sqlite
setup:
- script: |
echo "Skip this step"
- template: _build/azure-pipelines-template.yml
parameters:
name: Windows_postgres
displayName: Windows PostgreSQL
vmImage: vs2017-win2016
variables:
BACKEND: postgres
PG_DATABASE_URL: postgres://postgres:password@localhost/
PG_EXAMPLE_DATABASE_URL: postgres://postgres:password@localhost/diesel_example
PQ_LIB_DIR: C:\Program Files\PostgreSQL\10\lib
setup:
- script: |
choco install postgresql10 --force --params '/Password:password'
set PATH=%PATH%;C:\Program Files\PostgreSQL\10\bin;C:\Program Files\PostgreSQL\10\lib"
echo "##vso[task.setvariable variable=PATH;]%PATH%;C:\Program Files\PostgreSQL\10\bin;C:\Program Files\PostgreSQL\10\lib"
displayName: Install postgresql
- template: _build/azure-pipelines-template.yml
parameters:
name: Windows_mysql
displayName: Windows MySQL
vmImage: vs2017-win2016
variables:
BACKEND: mysql
MYSQL_DATABASE_URL: mysql://root:password@localhost/diesel_test
MYSQL_EXAMPLE_DATABASE_URL: mysql://root:password@localhost/diesel_example
MYSQL_UNIT_TEST_DATABASE_URL: mysql://root:password@localhost/diesel_unit_test
RUST_TEST_THREADS: 1
MYSQLCLIENT_LIB_DIR: C:\Program Files\MySQL\MySQL Server 8.0\lib
setup:
- script: |
choco install 7zip
mkdir C:\mysql
CD /D C:\mysql
curl -fsS --retry 3 --retry-connrefused -o mysql.msi https://cdn.mysql.com/archives/mysql-installer/mysql-installer-community-8.0.11.0.msi
msiexec /q /log install.txt /i mysql.msi datadir=C:\mysql installdir=C:\mysql
call "C:\Program Files (x86)\MySQL\MySQL Installer for Windows\MySQLInstallerConsole.exe" community install server;8.0.11;x64:*:port=3306;rootpasswd=password;servicename=MySQL -silent
netsh advfirewall firewall add rule name="Allow mysql" dir=in action=allow edge=yes remoteip=any protocol=TCP localport=80,8080,3306
"C:\Program Files\MySQL\MySQL Server 8.0\bin\mysql" -e "create database diesel_test; create database diesel_unit_test; grant all on diesel_test.* to 'root'@localhost; grant all on diesel_unit_test.* to 'root'@localhost;" -uroot -ppassword
displayName: Install mysql
- job: COMPILE_TESTS
displayName: Compiletests
pool:
vmImage: ubuntu-16.04
steps:
- template: _build/install-rust.yml
parameters:
platform: Linux
rust_version: nightly-2020-05-01
- bash: |
sudo apt-get update &&
sudo apt-get -y install libsqlite3-dev libpq-dev libmysqlclient-dev
displayName: Install build dependencies
- bash: |
(cd diesel_compile_tests && cargo test)
env:
RUSTFLAGS: '--cap-lints=warn'
displayName: Run compile tests
- job: RUSTFMT_AND_CLIPPY
displayName: Check rustfmt style && run clippy
pool:
vmImage: ubuntu-16.04
steps:
- template: _build/install-rust.yml
parameters:
platform: Linux
rust_version: 1.40.0
- bash: |
sudo apt-get update &&
sudo apt-get -y install libsqlite3-dev libpq-dev libmysqlclient-dev
displayName: Install build dependencies
- bash: |
rustup component add rustfmt
displayName: Install rustfmt
- bash: |
rustup component add clippy
displayName: Install clippy
- bash: |
cargo clippy
displayName: Run clippy
- bash: |
cargo fmt --all -- --check
displayName: Check style
- job: SQLITE_BUNDLED
displayName: Check sqlite bundled
pool:
vmImage: ubuntu-16.04
steps:
- template: _build/install-rust.yml
parameters:
platform: Linux
rust_version: stable
- bash: |
sudo apt-get update &&
sudo apt-get -y install sqlite3 libsqlite3-dev
- bash: |
(cd diesel_cli && cargo test --no-default-features --features "sqlite-bundled")
env:
SQLITE_DATABASE_URL: /tmp/test.db
displayName: Check sqlite bundled
- job: MINIMAL_RUST_VERSION
displayName: Check minimal supported rust version
pool:
vmImage: ubuntu-16.04
steps:
- template: _build/install-sqlite3.yml
parameters:
name: Linux_sqlite
- template: _build/install-rust.yml
parameters:
platform: Linux
rust_version: 1.40.0
- bash: |
sudo apt-get update &&
sudo apt-get install libpq-dev libmysqlclient-dev
displayName: Install build dependencies
- bash: |
cargo check --all
displayName: Check building with rust 1.40.0