Skip to content

deps(deps): bump actions/checkout from 6 to 7 in the actions group across 1 directory #386

deps(deps): bump actions/checkout from 6 to 7 in the actions group across 1 directory

deps(deps): bump actions/checkout from 6 to 7 in the actions group across 1 directory #386

Workflow file for this run

name: "Backend: CI"
on:
push:
branches: [ "main" ]
paths:
- 'rustytime/**'
- '.github/workflows/ci.yml'
pull_request:
branches: [ "main" ]
paths:
- 'rustytime/**'
- '.github/workflows/ci.yml'
env:
CARGO_TERM_COLOR: always
jobs:
rust-checks:
runs-on: ubuntu-latest
permissions:
actions: write
contents: read
services:
postgres:
image: timescale/timescaledb:latest-pg17
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: rustytime_test
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
defaults:
run:
working-directory: rustytime
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 1
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: "1.92"
components: rustfmt, clippy
- name: Cache cargo artifacts
uses: Swatinem/rust-cache@v2
with:
workspaces: rustytime -> target
shared-key: ci
- name: Install diesel CLI
run: curl --proto '=https' --tlsv1.2 -LsSf https://github.com/diesel-rs/diesel/releases/download/v2.3.5/diesel_cli-installer.sh | sh
# the latest release (2.3.6) doesn't have prebuilt binaries for some reason
- name: Run database migrations
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/rustytime_test
run: diesel migration run
- name: Cargo formatting check
run: cargo fmt --all -- --check
- name: Cargo clippy check
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Run tests
env:
TEST_DATABASE_URL: postgres://postgres:postgres@localhost:5432/rustytime_test
run: cargo test --locked --all-features