diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ad75d79f..9ef12c46 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,13 +17,28 @@ jobs: steps: - run: exit 0 + setup-matrix: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.setup-matrix.outputs.matrix }} + steps: + - id: get-msrv + uses: actions/checkout@v2 + run: | + echo "MSRV=$(grep -oP 'rust-version\s*=\s*"\K[^"]+' ./refinery/Cargo.toml)" >> "$GITHUB_ENV" + - id: setup-matrix + uses: druzsan/setup-matrix@v2 + with: + # Use | to preserve valid YAML syntax + matrix: | + rust: [stable, nightly, ${{ steps.get-msrv.outputs.MSRV }}] + cargo-fmt-clippy-and-test-macros-and-cli: name: Cargo fmt/clippy/test-macros-and-cli - runs-on: ${{ matrix.os }} + needs: setup-matrix + runs-on: [windows-latest, ubuntu-latest] strategy: - matrix: - os: [windows-latest, ubuntu-latest] - rust: [stable, nightly, 1.56.0] + matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix) }} steps: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 @@ -33,19 +48,18 @@ jobs: - run: rustup component add clippy - run: rustup component add rustfmt - run: cargo fmt --all -- --check + - run: cargo clippy --all-targets --all-features - run: cd refinery_core && cargo test --all-features -- --test-threads 1 - run: cd refinery && cargo build --all-features - - run: cd refinery_macros && cargo clippy - - run: cd refinery_cli && cargo clippy - run: cd refinery_macros && cargo test - run: cd refinery_cli && cargo test test-sqlite: name: Test Sqlite + needs: setup-matrix runs-on: ubuntu-latest strategy: - matrix: - rust: [stable, nightly, 1.65.0] + matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix) }} steps: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 @@ -56,10 +70,10 @@ jobs: test-postgres: name: Test postgres + needs: setup-matrix runs-on: ubuntu-latest strategy: - matrix: - rust: [stable, nightly, 1.56.0] + matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix) }} services: postgres: image: postgres:9.6.13-alpine @@ -75,10 +89,10 @@ jobs: test-tokio-postgres: name: Test tokio-postgres - runs-on: ubuntu-latest + needs: setup-matrix strategy: - matrix: - rust: [stable, nightly, 1.56.0] + matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix) }} + runs-on: ubuntu-latest services: postgres: image: postgres:9.6.13-alpine @@ -93,10 +107,10 @@ jobs: test-mysql: name: Test mysql + needs: setup-matrix runs-on: ubuntu-latest strategy: - matrix: - rust: [stable, nightly, 1.56.0] + matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix) }} services: postgres: image: mysql:latest @@ -117,10 +131,10 @@ jobs: test-mysql-async: name: Test mysql-async + needs: setup-matrix runs-on: ubuntu-latest strategy: - matrix: - rust: [stable, nightly, 1.56.0] + matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix) }} services: postgres: image: mysql:latest @@ -140,10 +154,10 @@ jobs: test-tiberius: name: Test tiberius + needs: setup-matrix runs-on: ubuntu-latest strategy: - matrix: - rust: [stable, nightly, 1.56.0] + matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix) }} services: mssql: image: mcr.microsoft.com/mssql/server:2017-latest diff --git a/refinery/Cargo.toml b/refinery/Cargo.toml index 0a054d4c..9b1bd901 100644 --- a/refinery/Cargo.toml +++ b/refinery/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "refinery" version = "0.8.12" -rust-version = "1.56" +rust-version = "1.75" authors = ["Katharina Fey ", "João Oliveira "] license = "MIT" description = "Powerful SQL migration toolkit for Rust"