Skip to content

Commit

Permalink
update CI to address MSRV
Browse files Browse the repository at this point in the history
  • Loading branch information
jxs committed Mar 1, 2024
1 parent 66fe68f commit 789f95d
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cargo-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
uses: actions/checkout@v3

- name: Setup toolchain
- uses: actions-rs/toolchain@v1
uses: actions-rs/toolchain@v1
with:
toolchain: stable

Expand Down
78 changes: 54 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ jobs:
name: CI is green
runs-on: ubuntu-latest
needs:
- cargo-fmt-clippy-and-test-macros-and-cli
- cargo-fmt-clippy
- test-macros-and-cli
- test-sqlite
- test-postgres
- test-tokio-postgres
Expand All @@ -17,35 +18,59 @@ jobs:
steps:
- run: exit 0

cargo-fmt-clippy-and-test-macros-and-cli:
name: Cargo fmt/clippy/test-macros-and-cli
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest]
rust: [stable, nightly, 1.56.0]
set-rust-versions:
runs-on: ubuntu-latest
outputs:
versions: ${{ steps.set-versions.outputs.versions }}
steps:
- name: checkout repo
uses: actions/checkout@v2
- id: set-versions
run: |
MSRV=$(grep -oP 'rust-version\s*=\s*"\K[^"]+' ./refinery/Cargo.toml)
echo "versions=['stable', 'nightly', '$MSRV']" >> $GITHUB_OUTPUT
cargo-fmt-clippy:
name: Cargo fmt and clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
toolchain: beta
- run: rustup self update
- run: rustup component add clippy
- run: rustup component add rustfmt
- run: cargo fmt --all -- --check
- run: cargo clippy --all-targets --all-features

test-macros-and-cli:
name: test-macros-and-cli
needs: set-rust-versions
strategy:
matrix:
rust: ${{ fromJson(needs.set-rust-versions.outputs.versions) }}
os: [windows-latest, ubuntu-latest]

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
- run: rustup self update
- 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: set-rust-versions
runs-on: ubuntu-latest
strategy:
matrix:
rust: [stable, nightly, 1.65.0]
matrix:
rust: ${{ fromJson(needs.set-rust-versions.outputs.versions) }}
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
Expand All @@ -56,10 +81,11 @@ jobs:

test-postgres:
name: Test postgres
needs: set-rust-versions
runs-on: ubuntu-latest
strategy:
matrix:
rust: [stable, nightly, 1.56.0]
matrix:
rust: ${{ fromJson(needs.set-rust-versions.outputs.versions) }}
services:
postgres:
image: postgres:9.6.13-alpine
Expand All @@ -75,10 +101,11 @@ jobs:

test-tokio-postgres:
name: Test tokio-postgres
runs-on: ubuntu-latest
needs: set-rust-versions
strategy:
matrix:
rust: [stable, nightly, 1.56.0]
matrix:
rust: ${{ fromJson(needs.set-rust-versions.outputs.versions) }}
runs-on: ubuntu-latest
services:
postgres:
image: postgres:9.6.13-alpine
Expand All @@ -93,10 +120,11 @@ jobs:

test-mysql:
name: Test mysql
needs: set-rust-versions
runs-on: ubuntu-latest
strategy:
matrix:
rust: [stable, nightly, 1.56.0]
matrix:
rust: ${{ fromJson(needs.set-rust-versions.outputs.versions) }}
services:
postgres:
image: mysql:latest
Expand All @@ -117,10 +145,11 @@ jobs:

test-mysql-async:
name: Test mysql-async
needs: set-rust-versions
runs-on: ubuntu-latest
strategy:
matrix:
rust: [stable, nightly, 1.56.0]
matrix:
rust: ${{ fromJson(needs.set-rust-versions.outputs.versions) }}
services:
postgres:
image: mysql:latest
Expand All @@ -140,10 +169,11 @@ jobs:

test-tiberius:
name: Test tiberius
needs: set-rust-versions
runs-on: ubuntu-latest
strategy:
matrix:
rust: [stable, nightly, 1.56.0]
matrix:
rust: ${{ fromJson(needs.set-rust-versions.outputs.versions) }}
services:
mssql:
image: mcr.microsoft.com/mssql/server:2017-latest
Expand Down
2 changes: 1 addition & 1 deletion refinery/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "refinery"
version = "0.8.12"
rust-version = "1.56"
rust-version = "1.75"
authors = ["Katharina Fey <[email protected]>", "João Oliveira <[email protected]>"]
license = "MIT"
description = "Powerful SQL migration toolkit for Rust"
Expand Down

0 comments on commit 789f95d

Please sign in to comment.