Skip to content

(cargo-release) version 0.5.0 #1211

(cargo-release) version 0.5.0

(cargo-release) version 0.5.0 #1211

Workflow file for this run

name: CI
on:
push:
jobs:
CI:
name: Lint, build, test
runs-on: ubuntu-latest
env:
# set debuginfo to 1 (line tables only, for panic tracebacks)
RUSTFLAGS: "-C debuginfo=1"
services:
postgres:
image: postgres:14
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: db_test
ports:
- 5432/tcp
options: >-
--health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v3
# Setup pre-commit
- name: Install pre-commit
run: |
sudo apt-get update
sudo apt-get install -y pre-commit
- name: Configure pre-commit cache
uses: actions/cache@v3
with:
path: ~/.cache/pre-commit
key: pre-commit-${{ runner.os }}-pre-commit-${{ hashFiles('**/.pre-commit-config.yaml') }}
# Use https://github.com/marketplace/actions/rust-cache
# selecting a toolchain either by action or manual `rustup` calls should happen
# before the plugin, as the cache uses the current rustc version as its cache key
- name: Install minimal nightly with clippy and rustfmt
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
components: rustfmt, clippy
- name: Install tool for formatting Cargo.toml files
run: cargo install cargo-tomlfmt
- uses: Swatinem/rust-cache@v2
with:
# shared-key: ""
# key: ""
# env-vars: ""
# workspaces: ""
# Determines if the cache should be saved even when the workflow has failed.
cache-on-failure: "true"
- name: Check pre-commit hooks (formatting and Clippy)
run: pre-commit run --all
- name: Build workspace in debug mode
run: |
cargo build
- name: Spin up the test object stores
run: docker compose up -d
# TODO split tests into unit and integration (one requires postgres?)
- name: Run tests
run: |
cargo test --workspace
env:
# Database URL for end-to-end + postgres repository tests; the host is `localhost` since we don't specify
# a child container to run the job in (and instead run everything in the root specified by `runs-on`).
# The port has been randomly assigned so we need to fetch it.
DATABASE_URL:
"postgres://postgres:postgres@localhost:${{ job.services.postgres.ports[5432] }}/db_test"
# TODO recompiles the whole thing with different flags (busting the cache?,
# also codecov needs a token for private repos; also this breaks in Docker
# because of security / ASLR disable fails)
# - name: Run coverage
# run: |
# cargo install --version 0.20.1 cargo-tarpaulin
# cargo tarpaulin --all --out Xml
# - name: Report coverage
# continue-on-error: true
# run: bash <(curl -s https://codecov.io/bash)