Skip to content

publish

publish #18

Workflow file for this run

name: tests
on:
pull_request:
paths-ignore:
- '**.md'
- '.github/ISSUE_TEMPLATE/**'
push:
paths-ignore:
- '**.md'
- '.github/ISSUE_TEMPLATE/**'
branches:
- main
- 1.*.x
- 0.*.x
- pr/**/ci
- ci-*
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref || github.run_id }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
jobs:
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: clippy
- run: cargo clippy --all -- -D warnings
- run: cargo clippy --manifest-path migration/Cargo.toml -- -D warnings
rustfmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
components: rustfmt
- run: cargo fmt --all -- --check
- run: cargo fmt --manifest-path migration/Cargo.toml --all -- --check
sqlite:
name: SQLite
runs-on: ubuntu-latest
env:
DATABASE_URL: "sqlite://db.sqlite?mode=rwc"
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo run --no-default-features --features sqlx-sqlite task seed_data
mysql:
name: MySQL
runs-on: ubuntu-latest
env:
DATABASE_URL: "mysql://root:@localhost/AdventureWorksLT2016"
strategy:
fail-fast: false
matrix:
version: [lts]
services:
mysql:
image: mysql:${{ matrix.version }}
env:
MYSQL_HOST: 127.0.0.1
MYSQL_DB: mysql
MYSQL_USER: sea
MYSQL_PASSWORD: sea
MYSQL_ALLOW_EMPTY_PASSWORD: yes
ports:
- "3306:3306"
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=3
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: mysql -uroot -h 127.0.0.1 mysql -e 'CREATE DATABASE `AdventureWorksLT2016`'
- run: cargo run --no-default-features --features sqlx-mysql task seed_data
mariadb:
name: MariaDB
runs-on: ubuntu-latest
env:
DATABASE_URL: "mysql://root:@localhost/AdventureWorksLT2016"
strategy:
fail-fast: false
matrix:
version: [lts]
services:
mariadb:
image: mariadb:${{ matrix.version }}
env:
MARIADB_HOST: 127.0.0.1
MARIADB_DB: mysql
MARIADB_USER: sea
MARIADB_PASSWORD: sea
MARIADB_ALLOW_EMPTY_ROOT_PASSWORD: yes
ports:
- "3306:3306"
options: >-
--health-cmd="healthcheck.sh
--connect
--innodb_initialized"
--health-interval=10s
--health-timeout=5s
--health-retries=3
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: mysql -uroot -h 127.0.0.1 mysql -e 'CREATE DATABASE `AdventureWorksLT2016`'
- run: cargo run --no-default-features --features sqlx-mysql task seed_data
postgres:
name: Postgres
runs-on: ubuntu-latest
env:
DATABASE_URL: "postgres://root:root@localhost/AdventureWorksLT2016"
strategy:
fail-fast: false
matrix:
version: [14, 16]
services:
postgres:
image: postgres:${{ matrix.version }}
env:
POSTGRES_HOST: 127.0.0.1
POSTGRES_USER: root
POSTGRES_PASSWORD: root
ports:
- "5432:5432"
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: psql -q postgres://root:root@localhost/postgres -c 'CREATE DATABASE "AdventureWorksLT2016"'
- run: cargo run --no-default-features --features sqlx-postgres task seed_data