Skip to content

Commit

Permalink
split test jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
ayrat555 committed Sep 8, 2023
1 parent f3a14d4 commit c57b0ba
Showing 1 changed file with 61 additions and 21 deletions.
82 changes: 61 additions & 21 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,29 @@ env :
DATABASE_URL : postgres://postgres:postgres@localhost/fang

jobs:
test:
name: Test
clippy:
name: Clippy
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
components: clippy
override: true
profile: minimal
toolchain: stable

- name: Run clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --verbose --all-targets --all-features -- -D warnings

test_postgres:
name: Test postgres
runs-on: ubuntu-latest

services:
Expand Down Expand Up @@ -46,14 +67,45 @@ jobs:
profile: minimal
toolchain: stable

- name: Run clippy
- name: Install diesel-cli
uses: actions-rs/cargo@v1
with:
command: clippy
args: --verbose --all-targets --all-features -- -D warnings
command: install
args: diesel_cli --no-default-features --features postgres

- name: Setup Postgres db
working-directory: ./fang/postgres_migrations
run: diesel setup --database-url "postgres://postgres:postgres@localhost/fang"

- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose --features asynk-postgres

- name: Run dirty tests
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose features asynk-postgres -- --ignored

test_sqlite:
name: Test
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
components: clippy
override: true
profile: minimal
toolchain: stable

- name: Install sqlite3
run: |
run: |
sudo apt install -y sqlite3
sqlite3 fang.db "VACUUM;"
mkdir tests_sqlite
Expand All @@ -62,35 +114,23 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: install
args: diesel_cli --no-default-features --features "postgres sqlite mysql"
args: diesel_cli --no-default-features --features sqlite

- name: Setup Sqlite db
working-directory: ./fang/sqlite_migrations
run: diesel setup --database-url "sqlite3://../../../fang.db"

- name: Change working dir
working-directory: ./../..
run: pwd

- name: Setup Postgres db
working-directory: ./fang/postgres_migrations
run: diesel setup --database-url "postgres://postgres:postgres@localhost/fang"

- name: Change working dir
working-directory: ./../..
run: pwd

- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose --all-features
args: --verbose --features asynk-sqlite

- name: Run dirty tests
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose --all-features -- --ignored
args: --verbose --features asynk-sqlite -- --ignored

release:
name: Release x86_64-unknown-linux-gnu
Expand Down

0 comments on commit c57b0ba

Please sign in to comment.