Skip to content

upgrade sea-orm to 1.0.0 RC 7 #1193

upgrade sea-orm to 1.0.0 RC 7

upgrade sea-orm to 1.0.0 RC 7 #1193

Workflow file for this run

name: ci-generators
on:
push:
branches:
- master
pull_request:
env:
RUST_TOOLCHAIN: stable
TOOLCHAIN_PROFILE: minimal
jobs:
test:
name: Run Tests
runs-on: ubuntu-latest
permissions:
contents: read
services:
redis:
image: redis
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- "6379:6379"
postgres:
image: postgres
env:
POSTGRES_DB: postgres_test
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- "5432:5432"
# Set health checks to wait until postgres has started
options: --health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout the code
uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
profile: ${{ env.TOOLCHAIN_PROFILE }}
toolchain: ${{ env.RUST_TOOLCHAIN }}
override: true
- name: Setup Rust cache
uses: Swatinem/rust-cache@v2
- name: Install seaorm cli
run: cargo install sea-orm-cli
- name: scaffold
run: cargo run -- generate scaffold car name:string year:int && cargo build
working-directory: ./examples/demo
env:
REDIS_URL: redis://localhost:${{job.services.redis.ports[6379]}}
DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres_test
- name: model
run: cargo run -- generate model post title:string content:text && cargo build
working-directory: ./examples/demo
env:
REDIS_URL: redis://localhost:${{job.services.redis.ports[6379]}}
DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres_test
- name: controller
run: cargo run -- generate controller post && cargo build && cargo test requests::post
working-directory: ./examples/demo
env:
REDIS_URL: redis://localhost:${{job.services.redis.ports[6379]}}
DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres_test
- name: worker
run: cargo run -- generate worker report_worker && cargo build && cargo test workers::report_worker::test_run_report_worker_worker
working-directory: ./examples/demo
env:
REDIS_URL: redis://localhost:${{job.services.redis.ports[6379]}}
DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres_test
- name: mailer
run: cargo run -- generate mailer birthday_mailer && cargo build
working-directory: ./examples/demo
env:
REDIS_URL: redis://localhost:${{job.services.redis.ports[6379]}}
DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres_test
- name: task
run: cargo run -- generate task mytask && cargo build && cargo test tasks::mytask::test_can_run_mytask
working-directory: ./examples/demo
env:
REDIS_URL: redis://localhost:${{job.services.redis.ports[6379]}}
DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres_test
- name: docker deployment
run: cargo run -- generate deployment
working-directory: ./examples/demo
env:
LOCO_DEPLOYMENT_KIND: docker
REDIS_URL: redis://localhost:${{job.services.redis.ports[6379]}}
DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres_test
model_fields_generator:
name: Run Tests
runs-on: ubuntu-latest
permissions:
contents: read
services:
redis:
image: redis
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- "6379:6379"
postgres:
image: postgres
env:
POSTGRES_DB: postgres_test
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- "5432:5432"
# Set health checks to wait until postgres has started
options: --health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout the code
uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
profile: ${{ env.TOOLCHAIN_PROFILE }}
toolchain: ${{ env.RUST_TOOLCHAIN }}
override: true
- name: Setup Rust cache
uses: Swatinem/rust-cache@v2
- name: Install seaorm cli
run: cargo install sea-orm-cli
- name: test ${{ matrix.field_type }} model field type
run: |
cargo run -- generate model post \
uuid_uniq:uuid \
uuid_null:uuid_col \
uuid:uuid_col! \
string_null:string \
string:string! \
string_uniq:string^ \
text_null:text \
text:text! \
tiny_integer_null:tiny_int \
tiny_integer:tiny_int! \
tiny_integer_uniq:tiny_int^ \
small_integer_null:small_int \
small_integer:small_int! \
small_integer_uniq:small_int^ \
integer_null:int \
integer:int! \
integer_uniq:int^ \
big_integer_null:big_int \
big_integer:big_int! \
big_integer_uniq:big_int^ \
float_null:float \
float:float! \
double_null:double \
double:double! \
decimal_null:decimal \
decimal:decimal! \
decimal_len_null:decimal_len \
decimal_len:decimal_len! \
boolean_null:bool \
boolean:bool! \
timestamp_with_time_zone_null:tstz \
timestamp_with_time_zone:tstz! \
date_null:date \
date:date! \
timestamp_null:ts \
timestamp:ts! \
json_null:json \
json:json! \
json_binary_null:jsonb \
json_binary:jsonb! \
&& cargo build
working-directory: ./examples/demo
env:
REDIS_URL: redis://localhost:${{job.services.redis.ports[6379]}}
DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres_test