Skip to content

Add simple test infrastructure for testing DB queries #5120

Add simple test infrastructure for testing DB queries

Add simple test infrastructure for testing DB queries #5120

Workflow file for this run

name: CI
on:
push: {}
pull_request: {}
schedule:
- cron: "0 12 * * 1" # Every Monday at 12:00 UTC
env:
AWS_ACCESS_KEY_ID: AKIA46X5W6CZEAQSMRH7
jobs:
rustfmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Install Rust
run: rustup update stable && rustup default stable && rustup component add rustfmt
- run: cargo fmt --all --check
test:
name: Test
runs-on: ubuntu-latest
env:
TEST_DB_URL: postgres://postgres:postgres@localhost:5432/postgres
services:
postgres:
image: postgres:14
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- 5432:5432
steps:
- uses: actions/checkout@v4
- run: rustup toolchain install stable --profile minimal
- uses: Swatinem/rust-cache@v2
- name: Run tests
run: cargo test --workspace --all-targets
ci:
name: CI
runs-on: ubuntu-latest
steps:
- name: Checkout the source code
uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Test and build
run: docker build -t triagebot .
- name: Deploy to production
uses: rust-lang/simpleinfra/github-actions/upload-docker-image@master
with:
image: triagebot
repository: rust-triagebot
region: us-west-1
redeploy_ecs_cluster: rust-ecs-prod
redeploy_ecs_service: triagebot
aws_access_key_id: "${{ env.AWS_ACCESS_KEY_ID }}"
aws_secret_access_key: "${{ secrets.AWS_SECRET_ACCESS_KEY }}"
if: github.ref == 'refs/heads/master'