Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into requestcontext
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/errors.rs
  • Loading branch information
yinho999 committed Aug 10, 2024
2 parents 3b07485 + 723bfeb commit 22122b1
Show file tree
Hide file tree
Showing 144 changed files with 2,774 additions and 2,061 deletions.
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 2
updates:
- package-ecosystem: "cargo"
directory: "/"
schedule:
interval: "daily"
open-pull-requests-limit: 0

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
13 changes: 3 additions & 10 deletions .github/workflows/ci-example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,15 @@ jobs:
steps:
- name: Checkout the code
uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@stable
with:
profile: ${{ env.TOOLCHAIN_PROFILE }}
toolchain: ${{ env.RUST_TOOLCHAIN }}
override: true
components: rustfmt
- run: cargo fmt --all -- --check
working-directory: ./examples/demo

clippy:
name: Run Clippy
needs: [rustfmt]
runs-on: ubuntu-latest

permissions:
Expand All @@ -41,11 +38,9 @@ jobs:
steps:
- name: Checkout the code
uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@stable
with:
profile: ${{ env.TOOLCHAIN_PROFILE }}
toolchain: ${{ env.RUST_TOOLCHAIN }}
override: true
- name: Setup Rust cache
uses: Swatinem/rust-cache@v2
- name: Run cargo clippy
Expand Down Expand Up @@ -87,11 +82,9 @@ jobs:
steps:
- name: Checkout the code
uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@stable
with:
profile: ${{ env.TOOLCHAIN_PROFILE }}
toolchain: ${{ env.RUST_TOOLCHAIN }}
override: true
- name: Setup Rust cache
uses: Swatinem/rust-cache@v2
- name: Install seaorm cli
Expand Down
16 changes: 9 additions & 7 deletions .github/workflows/ci-generators.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,9 @@ jobs:
steps:
- name: Checkout the code
uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@stable
with:
profile: ${{ env.TOOLCHAIN_PROFILE }}
toolchain: ${{ env.RUST_TOOLCHAIN }}
override: true
- name: Setup Rust cache
uses: Swatinem/rust-cache@v2

Expand Down Expand Up @@ -109,6 +107,12 @@ jobs:
model_fields_generator:
name: Run Tests
runs-on: ubuntu-latest
strategy:
matrix:
db:
- "postgres://postgres:postgres@localhost:5432/postgres_test"
# XXX: need to clean up demo first
# - "sqlite://loco_app.sqlite?mode=rwc"

permissions:
contents: read
Expand Down Expand Up @@ -140,11 +144,9 @@ jobs:
steps:
- name: Checkout the code
uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@stable
with:
profile: ${{ env.TOOLCHAIN_PROFILE }}
toolchain: ${{ env.RUST_TOOLCHAIN }}
override: true
- name: Setup Rust cache
uses: Swatinem/rust-cache@v2

Expand Down Expand Up @@ -198,4 +200,4 @@ jobs:
working-directory: ./examples/demo
env:
REDIS_URL: redis://localhost:${{job.services.redis.ports[6379]}}
DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres_test
DATABASE_URL: ${{matrix.db}}
17 changes: 4 additions & 13 deletions .github/workflows/ci-starter-lightweight-service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,15 @@ jobs:
steps:
- name: Checkout the code
uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@stable
with:
profile: ${{ env.TOOLCHAIN_PROFILE }}
toolchain: ${{ env.RUST_TOOLCHAIN }}
override: true
components: rustfmt
- run: cargo fmt --all -- --check
working-directory: ./starters/lightweight-service

clippy:
name: Run Clippy
needs: [rustfmt]
runs-on: ubuntu-latest

permissions:
Expand All @@ -45,11 +42,9 @@ jobs:
steps:
- name: Checkout the code
uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@stable
with:
profile: ${{ env.TOOLCHAIN_PROFILE }}
toolchain: ${{ env.RUST_TOOLCHAIN }}
override: true
- name: Setup Rust cache
uses: Swatinem/rust-cache@v2
- name: Run cargo clippy
Expand All @@ -66,11 +61,9 @@ jobs:
steps:
- name: Checkout the code
uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@stable
with:
profile: ${{ env.TOOLCHAIN_PROFILE }}
toolchain: ${{ env.RUST_TOOLCHAIN }}
override: true
- name: Setup Rust cache
uses: Swatinem/rust-cache@v2
- name: Run cargo test
Expand All @@ -88,11 +81,9 @@ jobs:
# steps:
# - name: Checkout the code
# uses: actions/checkout@v4
# - uses: actions-rs/toolchain@v1
# - uses: dtolnay/rust-toolchain@stable
# with:
# profile: ${{ env.TOOLCHAIN_PROFILE }}
# toolchain: ${{ env.RUST_TOOLCHAIN }}
# override: true
# - name: Setup Rust cache
# uses: Swatinem/rust-cache@v2
# - name: Inject slug/short variables
Expand Down
29 changes: 13 additions & 16 deletions .github/workflows/ci-starter-rest-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,15 @@ jobs:
steps:
- name: Checkout the code
uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@stable
with:
profile: ${{ env.TOOLCHAIN_PROFILE }}
toolchain: ${{ env.RUST_TOOLCHAIN }}
override: true
components: rustfmt
- run: cargo fmt --all -- --check
working-directory: ./starters/rest-api

clippy:
name: Run Clippy
needs: [rustfmt]
runs-on: ubuntu-latest

permissions:
Expand All @@ -45,11 +42,9 @@ jobs:
steps:
- name: Checkout the code
uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@stable
with:
profile: ${{ env.TOOLCHAIN_PROFILE }}
toolchain: ${{ env.RUST_TOOLCHAIN }}
override: true
- name: Setup Rust cache
uses: Swatinem/rust-cache@v2
- name: Run cargo clippy
Expand All @@ -60,6 +55,11 @@ jobs:
name: Run Tests
needs: [rustfmt, clippy]
runs-on: ubuntu-latest
strategy:
matrix:
db:
- "postgres://postgres:postgres@localhost:5432/postgres_test"
- "sqlite://loco_app.sqlite?mode=rwc"

permissions:
contents: read
Expand Down Expand Up @@ -91,20 +91,19 @@ jobs:
steps:
- name: Checkout the code
uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@stable
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: Run cargo test
run: cargo test --all-features --all
run: cargo loco db reset && cargo loco db entities && cargo test --all-features --all
working-directory: ./starters/rest-api
env:
REDIS_URL: redis://localhost:${{job.services.redis.ports[6379]}}
DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres_test

DATABASE_URL: ${{matrix.db}}
# generate_template:
# name: Generate Template
# needs: [test]
Expand All @@ -116,11 +115,9 @@ jobs:
# steps:
# - name: Checkout the code
# uses: actions/checkout@v4
# - uses: actions-rs/toolchain@v1
# - uses: dtolnay/rust-toolchain@stable
# with:
# profile: ${{ env.TOOLCHAIN_PROFILE }}
# toolchain: ${{ env.RUST_TOOLCHAIN }}
# override: true
# - name: Setup Rust cache
# uses: Swatinem/rust-cache@v2
# - name: Inject slug/short variables
Expand Down
28 changes: 13 additions & 15 deletions .github/workflows/ci-starter-saas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,15 @@ jobs:
steps:
- name: Checkout the code
uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@stable
with:
profile: ${{ env.TOOLCHAIN_PROFILE }}
toolchain: ${{ env.RUST_TOOLCHAIN }}
override: true
components: rustfmt
- run: cargo fmt --all -- --check
working-directory: ./starters/saas

clippy:
name: Run Clippy
needs: [rustfmt]
runs-on: ubuntu-latest

permissions:
Expand All @@ -45,11 +42,9 @@ jobs:
steps:
- name: Checkout the code
uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@stable
with:
profile: ${{ env.TOOLCHAIN_PROFILE }}
toolchain: ${{ env.RUST_TOOLCHAIN }}
override: true
- name: Setup Rust cache
uses: Swatinem/rust-cache@v2
- name: Run cargo clippy
Expand All @@ -60,6 +55,11 @@ jobs:
name: Run Tests
needs: [rustfmt, clippy]
runs-on: ubuntu-latest
strategy:
matrix:
db:
- "postgres://postgres:postgres@localhost:5432/postgres_test"
- "sqlite://loco_app.sqlite?mode=rwc"

permissions:
contents: read
Expand Down Expand Up @@ -91,19 +91,19 @@ jobs:
steps:
- name: Checkout the code
uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@stable
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: Run cargo test
run: cargo test --all-features --all
run: cargo loco db reset && cargo loco db entities && cargo test --all-features --all
working-directory: ./starters/saas
env:
REDIS_URL: redis://localhost:${{job.services.redis.ports[6379]}}
DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres_test
DATABASE_URL: ${{matrix.db}}

# generate_template:
# name: Generate Template
Expand Down Expand Up @@ -140,11 +140,9 @@ jobs:
# steps:
# - name: Checkout the code
# uses: actions/checkout@v4
# - uses: actions-rs/toolchain@v1
# - uses: dtolnay/rust-toolchain@stable
# with:
# profile: ${{ env.TOOLCHAIN_PROFILE }}
# toolchain: ${{ env.RUST_TOOLCHAIN }}
# override: true
# - name: Setup Rust cache
# uses: Swatinem/rust-cache@v2
# - name: Inject slug/short variables
Expand Down
13 changes: 3 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,9 @@ jobs:
steps:
- name: Checkout the code
uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@stable
with:
profile: ${{ env.TOOLCHAIN_PROFILE }}
toolchain: ${{ env.RUST_TOOLCHAIN }}
override: true
components: rustfmt
- name: Run cargo fmt
uses: actions-rs/cargo@v1
Expand All @@ -35,7 +33,6 @@ jobs:

clippy:
name: Run Clippy
needs: [rustfmt]
runs-on: ubuntu-latest

permissions:
Expand All @@ -44,11 +41,9 @@ jobs:
steps:
- name: Checkout the code
uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@stable
with:
profile: ${{ env.TOOLCHAIN_PROFILE }}
toolchain: ${{ env.RUST_TOOLCHAIN }}
override: true
- name: Setup Rust cache
uses: Swatinem/rust-cache@v2
- name: Run cargo clippy
Expand All @@ -68,11 +63,9 @@ jobs:
steps:
- name: Checkout the code
uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@stable
with:
profile: ${{ env.TOOLCHAIN_PROFILE }}
toolchain: ${{ env.RUST_TOOLCHAIN }}
override: true
- name: Setup Rust cache
uses: Swatinem/rust-cache@v2
- name: Run cargo test
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,9 @@ jobs:
steps:
- name: Checkout the code
uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@stable
with:
profile: ${{ env.TOOLCHAIN_PROFILE }}
toolchain: ${{ env.RUST_TOOLCHAIN }}
override: true
components: rustfmt
- run: cargo install snipdoc --features exec
- run: snipdoc check
env:
Expand Down
Loading

0 comments on commit 22122b1

Please sign in to comment.