mirror of
https://github.com/launchbadge/sqlx.git
synced 2025-10-02 15:25:32 +00:00
Tweak CI and enable for PRs
* Tweak cache strategy for Rust * Tweak cache strategy some more * ci: trigger * Tweak the rest of the CI tasks
This commit is contained in:
parent
36d16c5cb2
commit
fe827a3337
48
.github/workflows/mariadb.yml
vendored
48
.github/workflows/mariadb.yml
vendored
@ -1,9 +1,13 @@
|
||||
name: MariaDB
|
||||
|
||||
on: [push]
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
test:
|
||||
mariadb:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
@ -26,30 +30,34 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
|
||||
- name: Cache cargo registry
|
||||
uses: actions/cache@v1
|
||||
# Rust ------------------------------------------------
|
||||
|
||||
- name: Install Rust toolchain
|
||||
uses: actions-rs/toolchain@v1
|
||||
if: steps.cache_rust.outputs.cache-hit != 'true'
|
||||
with:
|
||||
path: ~/.cargo/registry
|
||||
key: ${{ runner.os }}-mysql-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
|
||||
|
||||
- name: Cache cargo index
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.cargo/git
|
||||
key: ${{ runner.os }}-mysql-cargo-index-${{ hashFiles('**/Cargo.lock') }}
|
||||
|
||||
- name: Cache cargo build
|
||||
toolchain: stable
|
||||
profile: minimal
|
||||
override: true
|
||||
|
||||
- name: Cache target/
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: target
|
||||
key: ${{ runner.os }}-mysql-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
|
||||
key: ${{ runner.os }}-cargo-build-target-mariadb-${{ hashFiles('**/Cargo.lock') }}
|
||||
|
||||
- name: Setup rust
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
override: true
|
||||
# -----------------------------------------------------
|
||||
|
||||
- run: cargo test -p sqlx --no-default-features --features 'mysql macros chrono'
|
||||
env:
|
||||
DATABASE_URL: mariadb://root:password@localhost:${{ job.services.mariadb.ports[3306] }}/sqlx
|
||||
|
||||
# Rust ------------------------------------------------
|
||||
|
||||
- name: Prepare build directory for cache
|
||||
run: |
|
||||
find ./target/debug -maxdepth 1 -type f -delete \
|
||||
&& rm -fr ./target/debug/{deps,.fingerprint}/*sqlx* \
|
||||
&& rm -f ./target/.rustc_info.json
|
||||
|
||||
# -----------------------------------------------------
|
||||
|
48
.github/workflows/mysql.yml
vendored
48
.github/workflows/mysql.yml
vendored
@ -1,9 +1,13 @@
|
||||
name: MySQL
|
||||
|
||||
on: [push]
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
test:
|
||||
mysql:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
@ -26,30 +30,34 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
|
||||
- name: Cache cargo registry
|
||||
uses: actions/cache@v1
|
||||
# Rust ------------------------------------------------
|
||||
|
||||
- name: Install Rust toolchain
|
||||
uses: actions-rs/toolchain@v1
|
||||
if: steps.cache_rust.outputs.cache-hit != 'true'
|
||||
with:
|
||||
path: ~/.cargo/registry
|
||||
key: ${{ runner.os }}-mysql-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
|
||||
|
||||
- name: Cache cargo index
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.cargo/git
|
||||
key: ${{ runner.os }}-mysql-cargo-index-${{ hashFiles('**/Cargo.lock') }}
|
||||
|
||||
- name: Cache cargo build
|
||||
toolchain: stable
|
||||
profile: minimal
|
||||
override: true
|
||||
|
||||
- name: Cache target/
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: target
|
||||
key: ${{ runner.os }}-mysql-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
|
||||
key: ${{ runner.os }}-cargo-build-target-mysql-${{ hashFiles('**/Cargo.lock') }}
|
||||
|
||||
- name: Setup rust
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
override: true
|
||||
# -----------------------------------------------------
|
||||
|
||||
- run: cargo test -p sqlx --no-default-features --features 'mysql macros chrono'
|
||||
env:
|
||||
DATABASE_URL: mysql://root:password@localhost:${{ job.services.mysql.ports[3306] }}/sqlx
|
||||
|
||||
# Rust ------------------------------------------------
|
||||
|
||||
- name: Prepare build directory for cache
|
||||
run: |
|
||||
find ./target/debug -maxdepth 1 -type f -delete \
|
||||
&& rm -fr ./target/debug/{deps,.fingerprint}/*sqlx* \
|
||||
&& rm -f ./target/.rustc_info.json
|
||||
|
||||
# -----------------------------------------------------
|
||||
|
42
.github/workflows/postgres.yml
vendored
42
.github/workflows/postgres.yml
vendored
@ -1,9 +1,13 @@
|
||||
name: Postgres
|
||||
|
||||
on: [push]
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
test:
|
||||
postgres:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
@ -27,30 +31,34 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
|
||||
- name: Setup rust
|
||||
# Rust ------------------------------------------------
|
||||
|
||||
- name: Install Rust toolchain
|
||||
uses: actions-rs/toolchain@v1
|
||||
if: steps.cache_rust.outputs.cache-hit != 'true'
|
||||
with:
|
||||
toolchain: stable
|
||||
profile: minimal
|
||||
override: true
|
||||
|
||||
- name: Cache cargo registry
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.cargo/registry
|
||||
key: ${{ runner.os }}-postgres-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
|
||||
|
||||
- name: Cache cargo index
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.cargo/git
|
||||
key: ${{ runner.os }}-postgres-cargo-index-${{ hashFiles('**/Cargo.lock') }}
|
||||
|
||||
- name: Cache cargo build
|
||||
- name: Cache target/
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: target
|
||||
key: ${{ runner.os }}-postgres-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
|
||||
key: ${{ runner.os }}-cargo-build-target-postgres-${{ hashFiles('**/Cargo.lock') }}
|
||||
|
||||
# -----------------------------------------------------
|
||||
|
||||
- run: cargo test -p sqlx --no-default-features --features 'postgres macros uuid chrono'
|
||||
env:
|
||||
DATABASE_URL: postgres://postgres:postgres@localhost:${{ job.services.postgres.ports[5432] }}/postgres
|
||||
|
||||
# Rust ------------------------------------------------
|
||||
|
||||
- name: Prepare build directory for cache
|
||||
run: |
|
||||
find ./target/debug -maxdepth 1 -type f -delete \
|
||||
&& rm -fr ./target/debug/{deps,.fingerprint}/*sqlx* \
|
||||
&& rm -f ./target/.rustc_info.json
|
||||
|
||||
# -----------------------------------------------------
|
||||
|
50
.github/workflows/rust.yml
vendored
50
.github/workflows/rust.yml
vendored
@ -1,6 +1,10 @@
|
||||
name: Rust
|
||||
|
||||
on: [push]
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@ -10,38 +14,34 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
|
||||
- name: Cache rust
|
||||
id: cache_rust
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.rustup/toolchains
|
||||
key: ${{ runner.os }}-rust-${{ hashFiles('**/Cargo.lock') }}
|
||||
# Rust ------------------------------------------------
|
||||
|
||||
- name: Cache cargo registry
|
||||
uses: actions/cache@v1
|
||||
- name: Install Rust toolchain
|
||||
uses: actions-rs/toolchain@v1
|
||||
if: steps.cache_rust.outputs.cache-hit != 'true'
|
||||
with:
|
||||
path: ~/.cargo/registry
|
||||
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
|
||||
|
||||
- name: Cache cargo index
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.cargo/git
|
||||
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
|
||||
|
||||
- name: Cache cargo build
|
||||
toolchain: stable
|
||||
profile: minimal
|
||||
override: true
|
||||
|
||||
- name: Cache target/
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: target
|
||||
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
|
||||
|
||||
- name: Setup rust
|
||||
uses: actions-rs/toolchain@v1
|
||||
if: steps.cache_rust.outputs.cache-hit != 'true'
|
||||
with:
|
||||
toolchain: stable
|
||||
override: true
|
||||
# -----------------------------------------------------
|
||||
|
||||
- run: cargo check --all-features
|
||||
|
||||
- run: cargo test -p sqlx-core --all-features
|
||||
|
||||
# Rust ------------------------------------------------
|
||||
|
||||
- name: Prepare build directory for cache
|
||||
run: |
|
||||
find ./target/debug -maxdepth 1 -type f -delete \
|
||||
&& rm -fr ./target/debug/{deps,.fingerprint}/*sqlx* \
|
||||
&& rm -f ./target/.rustc_info.json
|
||||
|
||||
# -----------------------------------------------------
|
||||
|
8
.github/workflows/rustfmt.yml
vendored
8
.github/workflows/rustfmt.yml
vendored
@ -1,9 +1,13 @@
|
||||
name: Format
|
||||
|
||||
on: [push]
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
check:
|
||||
format:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user