Skip to content

add sqlx connection #34

add sqlx connection

add sqlx connection #34

Workflow file for this run

name: gate
on:
push:
branches:
- main
pull_request:
jobs:
check-style:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: setup rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: rustfmt
- name: check style
uses: actions-rust-lang/rustfmt@v1
analyze:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: setup rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: clippy
- name: lint
run: cargo clippy
check-web-style:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: install dependencies
run: |
curl -L https://github.com/biomejs/biome/releases/download/cli%2Fv1.3.3/biome-linux-x64 -o biome
chmod +x biome
- name: check style
run: ./biome check src/static/js
run-unit-tests:
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
env:
APP_DATABASE_URI: postgresql://postgres:postgres@localhost/postgres
APP_ENV: ci
steps:
- uses: actions/checkout@v4
- name: setup rust
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: run unit tests
run: cargo test
build:
runs-on: ubuntu-latest
needs: [check-style, analyze, run-unit-tests]
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- name: build image
uses: docker/build-push-action@v5
with:
context: .