-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master' into fix/auto_type_defs
- Loading branch information
Showing
178 changed files
with
3,469 additions
and
695 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
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -21,24 +21,21 @@ concurrency: | |
jobs: | ||
check_and_test: | ||
name: Check | ||
needs: [sqlite_bundled, rustfmt_and_clippy] | ||
needs: [sqlite_bundled, rustfmt_and_clippy, postgres_bundled] | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
rust: ["stable", "beta", "nightly"] | ||
backend: ["postgres", "sqlite", "mysql"] | ||
os: [ubuntu-latest, macos-latest, windows-2019] | ||
os: [ubuntu-latest, macos-latest, macos-14, windows-2019] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
|
||
- name: Cache cargo registry | ||
uses: actions/cache@v3 | ||
uses: Swatinem/rust-cache@v2 | ||
with: | ||
path: | | ||
~/.cargo/registry | ||
~/.cargo/git | ||
key: ${{ runner.os }}-${{ matrix.backend }}-cargo-${{ hashFiles('**/Cargo.toml') }} | ||
|
||
- name: Set environment variables | ||
|
@@ -121,14 +118,23 @@ jobs: | |
echo "MYSQL_UNIT_TEST_DATABASE_URL=mysql://root:root@localhost/diesel_unit_test" >> $GITHUB_ENV | ||
- name: Install postgres (MacOS) | ||
if: runner.os == 'macOS' && matrix.backend == 'postgres' | ||
if: matrix.os == 'macos-latest' && matrix.backend == 'postgres' | ||
run: | | ||
initdb -D /usr/local/var/postgres | ||
pg_ctl -D /usr/local/var/postgres start | ||
sleep 3 | ||
createuser -s postgres | ||
echo "PG_DATABASE_URL=postgres://postgres@localhost/" >> $GITHUB_ENV | ||
echo "PG_EXAMPLE_DATABASE_URL=postgres://postgres@localhost/diesel_example" >> $GITHUB_ENV | ||
- name: Install postgres (MacOS M1) | ||
if: matrix.os == 'macos-14' && matrix.backend == 'postgres' | ||
run: | | ||
brew install postgresql | ||
brew services start postgresql@14 | ||
sleep 3 | ||
createuser -s postgres | ||
echo "PG_DATABASE_URL=postgres://postgres@localhost/" >> $GITHUB_ENV | ||
echo "PG_EXAMPLE_DATABASE_URL=postgres://postgres@localhost/diesel_example" >> $GITHUB_ENV | ||
- name: Install sqlite (MacOS) | ||
if: runner.os == 'macOS' && matrix.backend == 'sqlite' | ||
|
@@ -137,7 +143,7 @@ jobs: | |
echo "SQLITE_DATABASE_URL=/tmp/test.db" >> $GITHUB_ENV | ||
- name: Install mysql (MacOS) | ||
if: runner.os == 'macOS' && matrix.backend == 'mysql' | ||
if: matrix.os == 'macos-latest' && matrix.backend == 'mysql' | ||
run: | | ||
brew install [email protected] | ||
/usr/local/opt/[email protected]/bin/mysql_install_db | ||
|
@@ -149,6 +155,20 @@ jobs: | |
echo "MYSQL_UNIT_TEST_DATABASE_URL=mysql://runner@localhost/diesel_unit_test" >> $GITHUB_ENV | ||
echo "MYSQLCLIENT_LIB_DIR=/usr/local/opt/[email protected]/lib" >> $GITHUB_ENV | ||
- name: Install mysql (MacOS M1) | ||
if: matrix.os == 'macos-14' && matrix.backend == 'mysql' | ||
run: | | ||
brew install [email protected] | ||
ls /opt/homebrew/opt/[email protected] | ||
/opt/homebrew/opt/[email protected]/bin/mysql_install_db | ||
/opt/homebrew/opt/[email protected]/bin/mysql.server start | ||
sleep 3 | ||
/opt/homebrew/opt/[email protected]/bin/mysql -e "create database diesel_test; create database diesel_unit_test; grant all on \`diesel_%\`.* to 'runner'@'localhost';" -urunner | ||
echo "MYSQL_DATABASE_URL=mysql://runner@localhost/diesel_test" >> $GITHUB_ENV | ||
echo "MYSQL_EXAMPLE_DATABASE_URL=mysql://runner@localhost/diesel_example" >> $GITHUB_ENV | ||
echo "MYSQL_UNIT_TEST_DATABASE_URL=mysql://runner@localhost/diesel_unit_test" >> $GITHUB_ENV | ||
echo "MYSQLCLIENT_LIB_DIR=/opt/homebrew/opt/[email protected]/lib" >> $GITHUB_ENV | ||
- name: Install sqlite (Windows) | ||
if: runner.os == 'Windows' && matrix.backend == 'sqlite' | ||
shell: cmd | ||
|
@@ -240,7 +260,7 @@ jobs: | |
env: | ||
BACKEND: ${{ matrix.backend }} | ||
run: | | ||
(cd examples/${{ matrix.backend }} && rustup run ${{ matrix.rust }} bash test_all) | ||
(cd examples/${{ matrix.backend }} && rustup run ${{ matrix.rust }} bash test_all) | ||
- name: Test migrations-internals | ||
shell: bash | ||
|
@@ -300,16 +320,13 @@ jobs: | |
name: Compiletests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: nightly-2023-09-21 | ||
- name: Cache cargo registry | ||
uses: actions/cache@v3 | ||
uses: Swatinem/rust-cache@v2 | ||
with: | ||
path: | | ||
~/.cargo/registry | ||
~/.cargo/git | ||
key: compile_test-cargo-${{ hashFiles('**/Cargo.toml') }} | ||
|
||
- name: Install dependencies | ||
|
@@ -325,16 +342,13 @@ jobs: | |
name: Check rustfmt style && run clippy | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@stable | ||
with: | ||
components: clippy, rustfmt | ||
- name: Cache cargo registry | ||
uses: actions/cache@v3 | ||
uses: Swatinem/rust-cache@v2 | ||
with: | ||
path: | | ||
~/.cargo/registry | ||
~/.cargo/git | ||
key: clippy-cargo-${{ hashFiles('**/Cargo.toml') }} | ||
|
||
- name: Install dependencies | ||
|
@@ -405,16 +419,14 @@ jobs: | |
name: Check sqlite bundled + Sqlite with asan | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: dtolnay/rust-toolchain@nightly | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: nightly | ||
components: "rust-src" | ||
- name: Cache cargo registry | ||
uses: actions/cache@v3 | ||
uses: Swatinem/rust-cache@v2 | ||
with: | ||
path: | | ||
~/.cargo/registry | ||
~/.cargo/git | ||
key: sqlite_bundled-cargo-${{ hashFiles('**/Cargo.toml') }} | ||
|
||
- name: Test diesel-cli | ||
|
@@ -432,22 +444,57 @@ jobs: | |
RUSTFLAGS: -Zsanitizer=address | ||
ASAN_OPTIONS: detect_stack_use_after_return=1 | ||
run: cargo +nightly -Z build-std test --manifest-path diesel/Cargo.toml --no-default-features --features "sqlite extras libsqlite3-sys libsqlite3-sys/bundled libsqlite3-sys/with-asan" --target x86_64-unknown-linux-gnu | ||
postgres_bundled: | ||
name: Check postgres bundled + Postgres with asan | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: dtolnay/rust-toolchain@nightly | ||
with: | ||
components: "rust-src" | ||
- name: Cache cargo registry | ||
uses: Swatinem/rust-cache@v2 | ||
with: | ||
key: postgres_bundled-cargo-${{ hashFiles('**/Cargo.toml') }} | ||
- name: Install postgres (Linux) | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y libpq-dev postgresql valgrind | ||
echo "host all all 127.0.0.1/32 md5" > sudo tee -a /etc/postgresql/10/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 | ||
echo "PG_DATABASE_URL=postgres://postgres:postgres@localhost/" >> $GITHUB_ENV | ||
echo $PG_DATABASE_URL | ||
- name: Test diesel-cli | ||
run: cargo +nightly test --manifest-path diesel_cli/Cargo.toml --no-default-features --features "postgres-bundled" | ||
|
||
- name: Run diesel_tests with ASAN enabled | ||
env: | ||
RUSTFLAGS: -Zsanitizer=address | ||
ASAN_OPTIONS: detect_stack_use_after_return=1 | ||
run: cargo +nightly -Z build-std test --manifest-path diesel_tests/Cargo.toml --no-default-features --features "postgres pq-sys pq-sys/bundled pq-src/with-asan" --target x86_64-unknown-linux-gnu | ||
|
||
- name: Run diesel tests with ASAN enabled | ||
env: | ||
RUSTDOCFLAGS: -Zsanitizer=address | ||
RUSTFLAGS: -Zsanitizer=address | ||
ASAN_OPTIONS: detect_stack_use_after_return=1 | ||
run: cargo +nightly -Z build-std test --manifest-path diesel/Cargo.toml --no-default-features --features "postgres pq-sys pq-sys/bundled pq-src/with-asan" --target x86_64-unknown-linux-gnu | ||
|
||
minimal_rust_version: | ||
name: Check Minimal supported rust version (1.70.0) | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/[email protected] | ||
- uses: dtolnay/rust-toolchain@nightly | ||
- uses: taiki-e/install-action@cargo-hack | ||
- uses: taiki-e/install-action@cargo-minimal-versions | ||
- name: Cache cargo registry | ||
uses: actions/cache@v3 | ||
uses: Swatinem/rust-cache@v2 | ||
with: | ||
path: | | ||
~/.cargo/registry | ||
~/.cargo/git | ||
key: minimal_rust_version-cargo-${{ hashFiles('**/Cargo.toml') }} | ||
- name: Install dependencies | ||
run: | | ||
|
@@ -462,7 +509,7 @@ jobs: | |
- name: Check diesel_migrations | ||
run: cargo +1.70.0 minimal-versions check -p diesel_migrations --all-features | ||
- name: Check diesel_cli | ||
run: cargo +1.70.0 minimal-versions check -p diesel_cli --all-features | ||
run: cargo +1.70.0 minimal-versions check -p diesel_cli --features "default sqlite-bundled" | ||
|
||
typos: | ||
name: Spell Check with Typos | ||
|
@@ -471,7 +518,7 @@ jobs: | |
|
||
steps: | ||
- name: Checkout Actions Repository | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
|
||
- name: Check the spelling of the files in our repo | ||
uses: crate-ci/typos@master |
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
Oops, something went wrong.