Skip to content

min rust version

min rust version #255

Workflow file for this run

name: loco-generate
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: postgress_test
POSTGRES_USER: postgress
POSTGRES_PASSWORD: postgress
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://postgress:postgress@localhost:5432/postgress_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://postgress:postgress@localhost:5432/postgress_test
- name: controller
run: cargo run -- generate controller post && cargo build
working-directory: ./examples/demo
env:
REDIS_URL: redis://localhost:${{job.services.redis.ports[6379]}}
DATABASE_URL: postgres://postgress:postgress@localhost:5432/postgress_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://postgress:postgress@localhost:5432/postgress_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://postgress:postgress@localhost:5432/postgress_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://postgress:postgress@localhost:5432/postgress_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://postgress:postgress@localhost:5432/postgress_test