Merge pull request #40 from iamsauravsharma/fake-apply-support #258
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
jobs: | |
build: | |
name: Build | |
strategy: | |
matrix: | |
include: | |
- os: "ubuntu-latest" | |
rust-version: "stable" | |
- os: "macos-latest" | |
rust-version: "stable" | |
- os: "windows-latest" | |
rust-version: "stable" | |
- os: "ubuntu-latest" | |
rust-version: "beta" | |
- os: "ubuntu-latest" | |
rust-version: "nightly" | |
runs-on: ${{ matrix.os }} | |
env: | |
MAKE_FEATURES_FLAG: "--all-features" | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup rust toolchain | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.rust-version }} | |
components: rustfmt, clippy | |
- name: Install cargo make | |
uses: davidB/[email protected] | |
- name: Create env file | |
uses: iamsauravsharma/[email protected] | |
with: | |
input-prefix: "MAKE_" | |
- name: Run tests | |
run: | | |
cargo make --env-file=.env full | |
run_example: | |
name: Run Example | |
runs-on: "ubuntu-latest" | |
needs: build | |
env: | |
SQLITE_DATABASE_URL: "db.sqlite3" | |
POSTGRES_DATABASE_URL: postgresql://postgres:[email protected]:5432/postgres | |
MYSQL_DATABASE_URL: mysql://root:[email protected]:3306/default_db | |
services: | |
postgres: | |
image: postgres | |
env: | |
POSTGRES_PASSWORD: postgres | |
ports: | |
- 5432:5432 | |
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | |
mysql: | |
image: mysql | |
env: | |
MYSQL_ROOT_PASSWORD: mysql | |
MYSQL_DATABASE: default_db | |
ports: | |
- 3306:3306 | |
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup rust toolchain | |
uses: dtolnay/rust-toolchain@nightly | |
- name: Install cargo make | |
uses: davidB/rust-cargo-make@v1 | |
- name: Print cli help message | |
run: | | |
cargo make run_postgres_example --help | |
cargo make run_postgres_example apply --help | |
cargo make run_postgres_example drop --help | |
cargo make run_postgres_example list --help | |
cargo make run_postgres_example revert --help | |
- name: Run postgres example | |
run: | | |
cargo make run_postgres_example apply | |
cargo make run_postgres_example list | |
cargo make run_postgres_example revert --all --force | |
cargo make run_postgres_example list | |
cargo make run_postgres_example drop | |
- name: Run sqlite example | |
run: | | |
touch db.sqlite3 | |
cargo make run_sqlite_example apply | |
cargo make run_sqlite_example list | |
cargo make run_sqlite_example revert --all --force | |
cargo make run_sqlite_example list | |
cargo make run_sqlite_example drop | |
- name: Run mysql example | |
run: | | |
cargo make run_mysql_example apply | |
cargo make run_mysql_example list | |
cargo make run_mysql_example revert --all --force | |
cargo make run_mysql_example list | |
cargo make run_mysql_example drop |