Skip to content

Commit

Permalink
Add prefork (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
kigawas authored Jul 30, 2024
1 parent af74864 commit d516231
Show file tree
Hide file tree
Showing 11 changed files with 312 additions and 178 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ HOST=0.0.0.0
PORT=3000
DATABASE_URL="sqlite://dev.db"
# DATABASE_URL="postgresql://postgres:postgres@localhost/clean-axum"
PREFORK=1
19 changes: 14 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,26 @@ jobs:
- uses: Swatinem/rust-cache@v2

# cargo build before check to speed up check
- run: cargo build

- run: cargo check && cargo fmt && cargo clippy

- run: cargo build --no-default-features && cargo check --no-default-features
if: matrix.os == 'windows-latest'
- run: cargo build && cargo check
if: matrix.os != 'windows-latest'

- run: cargo fmt && cargo clippy --no-default-features
if: matrix.os == 'windows-latest'
- run: cargo fmt && cargo clippy
if: matrix.os != 'windows-latest'

- run: cargo test --no-default-features
if: matrix.os == 'windows-latest'
- run: cargo test
if: matrix.os != 'windows-latest'

- name: Run server
shell: bash # for windows
run: |
cp .env.example .env
cargo run &
./target/debug/clean-axum &
while ! curl --output /dev/null --silent --head --fail http://localhost:3000; do sleep 0.5; done; echo ok;
- name: Check server
Expand Down
2 changes: 2 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
"codegen",
"dotenv",
"dotenvy",
"nonblocking",
"oneshot",
"openapi",
"prefork",
"Serde",
"Utoipa"
],
Expand Down
Loading

0 comments on commit d516231

Please sign in to comment.