Skip to content

add function to determian my age and ripp out hcaptcha-rs, its lighte… #171

add function to determian my age and ripp out hcaptcha-rs, its lighte…

add function to determian my age and ripp out hcaptcha-rs, its lighte… #171

on:
pull_request:
push:
branches:
- mistress
name: Check and Lint
env:
DATABASE_URL: postgres://luna:luna@localhost/luna
ROCKET_SECRET_KEY: kPWBnGHiSlAUw8ov2X7tsyqccI8vYBST0WgD0Ya0cKM=
jobs:
tests:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:latest
env:
POSTGRES_USER: luna
POSTGRES_PASSWORD: luna
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
--name my_postgres_container
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- run: sudo apt-get update
- run: sudo apt-get install --yes postgresql-client libpq-dev clang mold curl
- name: install nodejs-19
run: curl -fsSL https://deb.nodesource.com/setup_19.x | sudo -E bash -
- run: sudo apt install -y nodejs
- name: install yarn
run: corepack enable && corepack prepare yarn@stable --activate
- name: Increase max_connections and shared_buffers
run: |
docker exec -i my_postgres_container bash << EOF
sed -i -e 's/max_connections = 100/max_connections = 1000/' /var/lib/postgresql/data/postgresql.conf
sed -i -e 's/shared_buffers = 128MB/shared_buffers = 2GB/' /var/lib/postgresql/data/postgresql.conf
EOF
- run: docker restart --time 0 my_postgres_container
- name: install diesel and run migrations
run: cargo install diesel_cli --no-default-features --features "postgres" && diesel migration run
- name: install and build deps in static_src
run: cd static_src && yarn && yarn compile
- run: cargo test
check:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- run: sudo apt install -y mold clang
- run: cargo check
fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: sudo apt install -y mold clang
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- run: cargo fmt --all -- --check
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: sudo apt install -y mold clang
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- run: cargo clippy --all-features