Skip to content

feat: timeout handler middleware #342

feat: timeout handler middleware

feat: timeout handler middleware #342

Workflow file for this run

name: Rust
on:
push:
branches: ["master"]
pull_request:
branches: ["master"]
env:
CARGO_TERM_COLOR: always
jobs:
test:
name: Test
runs-on: ubuntu-22.04
strategy:
matrix:
mariadb: [11.8]
redis: [7.0.11, 7.2.5]
steps:
- name: Setup MariaDB
uses: ankane/setup-mariadb@v1
with:
database: master_db
mariadb-version: ${{ matrix.mariadb }}
- name: Setup Redis
uses: shogo82148/actions-setup-redis@v1
with:
redis-version: ${{ matrix.redis }}
- name: Checkout repository
uses: actions/checkout@v4
- name: Initialize MariaDB
run: |
sudo mariadb -e "DROP USER '$USER'@'localhost'";
sudo mariadb -e "CREATE USER 'api'@'localhost' IDENTIFIED BY '${{ secrets.MARIADB_PW }}'";
sudo mariadb -e "GRANT ALL PRIVILEGES ON *.* TO 'api'@'localhost'";
sudo mariadb -e "FLUSH PRIVILEGES";
- name: Setup Rust
uses: dtolnay/rust-toolchain@1.94.0
- name: Configure cache
uses: Swatinem/rust-cache@v2
- name: Run tests
env:
DATABASE_URL: mysql://api:${{ secrets.MARIADB_PW }}@localhost:3306/master_db
REDIS_URL: redis://localhost:6379
GQL_API_CURSOR_SECRET_KEY: ${{ secrets.GQL_API_CURSOR_SECRET_KEY }}
run: RUST_BACKTRACE=1 cargo test -F mysql
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@1.94.0
- name: Setup Clippy
run: rustup component add clippy
- name: Run clippy
run: |
cargo clippy --no-default-features -F mysql -- -D warnings
cargo clippy -r --no-default-features -F mysql -- -D warnings
cargo clippy -F mysql -- -D warnings
cargo clippy -r -F mysql -- -D warnings
cargo clippy --all-features -- -D warnings
cargo clippy -r --all-features -- -D warnings