Treat warnings as errors on CI builds (#2651)

This commit is contained in:
Yuri Astrakhan
2023-07-31 22:29:07 +02:00
committed by GitHub
parent a824e8468c
commit a8a0579713
4 changed files with 21 additions and 12 deletions

View File

@@ -33,6 +33,8 @@ jobs:
--release
--no-default-features
--features mysql,postgres,sqlite
env:
RUSTFLAGS: -D warnings
- uses: actions/upload-artifact@v3
with:
@@ -157,10 +159,9 @@ jobs:
# so we only check that it compiles.
- name: Chat (Check)
uses: actions-rs/cargo@v1
env:
with:
command: check
args: -p sqlx-example-postgres-check
args: -p sqlx-example-postgres-chat
- name: Files (Setup)
working-directory: examples/postgres/files

View File

@@ -55,6 +55,8 @@ jobs:
--manifest-path sqlx-core/Cargo.toml
--no-default-features
--features json,offline,migrate,_rt-${{ matrix.runtime }},_tls-${{ matrix.tls }}
env:
RUSTFLAGS: -D warnings
- uses: actions-rs/cargo@v1
with:
@@ -62,6 +64,8 @@ jobs:
args: >
--no-default-features
--features all-databases,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }},macros
env:
RUSTFLAGS: -D warnings
test:
name: Unit Test
@@ -211,7 +215,7 @@ jobs:
env:
SQLX_OFFLINE: true
SQLX_OFFLINE_DIR: .sqlx
RUSTFLAGS: --cfg sqlite_ipaddr
RUSTFLAGS: -D warnings --cfg sqlite_ipaddr
LD_LIBRARY_PATH: /tmp/sqlite3-lib
# Test macros in offline mode (still needs DATABASE_URL to run)
@@ -255,7 +259,7 @@ jobs:
env:
# FIXME: needed to disable `ltree` tests in Postgres 9.6
# but `PgLTree` should just fall back to text format
RUSTFLAGS: --cfg postgres_${{ matrix.postgres }}
RUSTFLAGS: -D warnings --cfg postgres_${{ matrix.postgres }}
with:
command: build
args: >
@@ -311,7 +315,7 @@ jobs:
SQLX_OFFLINE_DIR: .sqlx
# FIXME: needed to disable `ltree` tests in Postgres 9.6
# but `PgLTree` should just fall back to text format
RUSTFLAGS: --cfg postgres_${{ matrix.postgres }}
RUSTFLAGS: -D warnings --cfg postgres_${{ matrix.postgres }}
# Test macros in offline mode (still needs DATABASE_URL to run)
- uses: actions-rs/cargo@v1
@@ -421,7 +425,7 @@ jobs:
env:
SQLX_OFFLINE: true
SQLX_OFFLINE_DIR: .sqlx
RUSTFLAGS: --cfg mysql_${{ matrix.mysql }}
RUSTFLAGS: -D warnings --cfg mysql_${{ matrix.mysql }}
# Test macros in offline mode (still needs DATABASE_URL to run)
# MySQL 5.7 supports TLS but not TLSv1.3 as required by RusTLS.
@@ -517,7 +521,7 @@ jobs:
env:
SQLX_OFFLINE: true
SQLX_OFFLINE_DIR: .sqlx
RUSTFLAGS: --cfg mariadb_${{ matrix.mariadb }}
RUSTFLAGS: -D warnings --cfg mariadb_${{ matrix.mariadb }}
# Test macros in offline mode (still needs DATABASE_URL to run)
- uses: actions-rs/cargo@v1