Skip to content

refactor: renamed to melba #41

refactor: renamed to melba

refactor: renamed to melba #41

Workflow file for this run

name: CI
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
env:
CARGO_TERM_COLOR: always
jobs:
test:
name: Test for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
services:
postgres:
image: postgres:13
env:
POSTGRES_USER: musicbrainz
POSTGRES_PASSWORD: musicbrainz
POSTGRES_DB: musicbrainz_db
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U musicbrainz"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- name: Install PostgreSQL Client
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y postgresql-client
- name: Wait for PostgreSQL
run: |
until pg_isready -h localhost -p 5432 -U musicbrainz; do
echo "Waiting for PostgreSQL to start..."
sleep 1
done
- name: Copy example config files
run: cp config/development.example.toml config/development.toml
- name: Populate Test Data
env:
PGPASSWORD: musicbrainz
run: |
for sql_file in ./tests/fixtures/*.sql; do
psql -h localhost -p 5432 -U musicbrainz -d musicbrainz_db -f "$sql_file"
done
- name: Verify Table Existence
env:
PGPASSWORD: musicbrainz
run: |
psql -h localhost -p 5432 -U musicbrainz -d musicbrainz_db -c '\dt external_url_archiver.internet_archive_urls'
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
cache: false
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- name: Formatting
uses: clechasseur/rs-cargo@v2
with:
command: fmt
args: --check
continue-on-error: true
- name: Cargo Check
uses: clechasseur/rs-cargo@v2
with:
command: check
args: --all-targets --all-features --locked
continue-on-error: true
- name: Linting
uses: clechasseur/rs-cargo@v2
with:
command: clippy
args: --all-targets --all-features --locked -- -D warnings
continue-on-error: true
- name: Run Tests
env:
DATABASE_URL: postgres://musicbrainz:musicbrainz@localhost:5432/musicbrainz_db
run: cargo test -- --nocapture