Skip to content

Commit

Permalink
publish
Browse files Browse the repository at this point in the history
  • Loading branch information
billy1624 committed Feb 14, 2025
1 parent a2aab68 commit 378aa57
Show file tree
Hide file tree
Showing 93 changed files with 14,629 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# DATABASE_URL="mssql://sa:YourStrong()Passw0rd@localhost/AdventureWorksLT2016"
# DATABASE_URL="mysql://root:root@localhost/AdventureWorksLT2016"
# DATABASE_URL="postgres://root:root@localhost/adventureworkslt2016"
DATABASE_URL="sqlite://db.sqlite?mode=rwc"
4 changes: 4 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# DATABASE_URL="mssql://sa:YourStrong()Passw0rd@localhost/AdventureWorksLT2016"
# DATABASE_URL="mysql://root:root@localhost/AdventureWorksLT2016"
# DATABASE_URL="postgres://root:root@localhost/adventureworkslt2016"
DATABASE_URL="sqlite://db.sqlite?mode=rwc"
153 changes: 153 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
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
21 changes: 21 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
**/config/local.yaml
**/config/*.local.yaml

# Generated by Cargo
# will have compiled files and executables
debug/
target/

# include cargo lock
!Cargo.lock

# These are backup files generated by rustfmt
**/*.rs.bk

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb

# SQLite
*.sqlite

.DS_Store
Loading

0 comments on commit 378aa57

Please sign in to comment.