feat: 🎸 Support sea_orm::ColumnTrait
with fully-qualification
#44
Workflow file for this run
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
name: "Test" | ||
on: [push] | ||
defaults: | ||
run: | ||
shell: bash -euo pipefail {0} | ||
jobs: | ||
rust-test: | ||
timeout-minutes: 10 | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
sea: | ||
- { sea-orm: "1.0", sea-query: "0.31" } | ||
use-sea-orm: | ||
- true | ||
- false | ||
sqlx: | ||
- "0.7" | ||
- "0.8" | ||
exclude: | ||
- sea: { sea-orm: "1.0", sea-query: "0.31" } | ||
use-sea-orm: true | ||
sqlx: "0.8" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup Rust stable toolchain | ||
uses: dtolnay/rust-toolchain@nightly | ||
with: | ||
components: rustfmt | ||
- name: Install Coverage Tools | ||
run: | | ||
rustup component add llvm-tools-preview --toolchain nightly | ||
cargo +nightly install cargo-llvm-cov | ||
- name: Update dependencies | ||
run: | | ||
cargo remove sea-orm sea-query | ||
cargo remove --dev sea-orm sea-query sqlx sqlx-postgres | ||
cargo add sea-query@${{ matrix.sea.sea-query }} --no-default-features | ||
cargo add --dev sea-query@${{ matrix.sea.sea-query }} | ||
if [ "${{ matrix.use-sea-orm }}" == "true" ]; then | ||
cargo add sea-orm@${{ matrix.sea.sea-orm }} --no-default-features --optional | ||
cargo add --dev sea-orm@${{ matrix.sea.sea-orm }} --features macros | ||
fi | ||
cargo add --dev sqlx@${{ matrix.sqlx }} sqlx-postgres@${{ matrix.sqlx }} | ||
cat << EOF >> "$GITHUB_STEP_SUMMARY" | ||
## \`Cargo.toml\` | ||
\`\`\`toml | ||
$(cat Cargo.toml) | ||
\`\`\` | ||
EOF | ||
- name: Generate feature flags | ||
id: generate-flags | ||
run: | | ||
if [ "${{ matrix.use-sea-orm }}" == "true" ]; then | ||
echo "feature_flags=--all-features" >> "$GITHUB_OUTPUT" | ||
else | ||
echo "feature_flags=" >> "$GITHUB_OUTPUT" | ||
fi | ||
- name: Restore cache | ||
uses: Swatinem/rust-cache@v2 | ||
- name: Check code (dependencies only) | ||
run: cargo +nightly check ${{ steps.generate-flags.outputs.feature_flags }} | ||
- name: Check code (with dev-dependencies) | ||
run: cargo +nightly check --all-targets ${{ steps.generate-flags.outputs.feature_flags }} | ||
- name: Check test | ||
run: | | ||
cargo +nightly llvm-cov ${{ steps.generate-flags.outputs.feature_flags }} --doctests --lcov >> /tmp/coverage.lcov | ||
- name: Coveralls Parallel | ||
uses: coverallsapp/github-action@v2 | ||
with: | ||
files: /tmp/coverage.lcov | ||
flag-name: run-${{ join(matrix.*, '-') }} | ||
parallel: true | ||
rust-lint: | ||
timeout-minutes: 10 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup Rust stable toolchain | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
components: clippy | ||
- name: Install cargo-sort | ||
run: cargo install cargo-sort | ||
- name: Setup nightly cargo fmt | ||
run: rustup toolchain install nightly --component rustfmt | ||
- name: Restore cache | ||
uses: Swatinem/rust-cache@v2 | ||
- name: Check format | ||
run: cargo +nightly fmt --all -- --check | ||
- name: Check clippy | ||
run: cargo clippy --all-features -- -D warnings | ||
- name: Check sort | ||
run: cargo sort -w -c | ||
aggregate-coverages: | ||
needs: test | ||
if: ${{ always() }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Coveralls Finished | ||
uses: coverallsapp/github-action@v2 | ||
with: | ||
parallel-finished: true |