Skip to content

Commit

Permalink
GitHub Workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
tyt2y3 committed Aug 23, 2021
1 parent 3f7de13 commit 8cfa142
Showing 1 changed file with 40 additions and 24 deletions.
64 changes: 40 additions & 24 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,40 @@ env:
CARGO_TERM_COLOR: always

jobs:

compile:
name: Compile
runs-on: ubuntu-20.04
strategy:
matrix:
database: [sqlite, mysql, postgres]
runtime: [async-std, actix, tokio]
tls: [native-tls, rustls]
steps:
- uses: actions/checkout@v2

- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
Cargo.lock
target
key: ${{ github.sha }}-${{ github.run_id }}-${{ runner.os }}-${{ matrix.database }}-${{ matrix.runtime }}-${{ matrix.tls }}

- uses: actions-rs/cargo@v1
with:
command: test
args: >
--features default,sqlx-${{ matrix.database }},runtime-${{ matrix.runtime }}-${{ matrix.tls }}
--no-run
test:
name: Unit Test
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -49,14 +83,12 @@ jobs:
args: >
--path sea-orm-cli
compile:
name: Compile
runs-on: ubuntu-20.04
examples:
name: Examples
runs-on: ${{ matrix.os }}
strategy:
matrix:
database: [sqlite, mysql, postgres]
runtime: [async-std, actix, tokio]
tls: [native-tls, rustls]
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v2

Expand All @@ -66,33 +98,17 @@ jobs:
toolchain: stable
override: true

- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
Cargo.lock
target
key: ${{ github.sha }}-${{ github.run_id }}-${{ runner.os }}-${{ matrix.database }}-${{ matrix.runtime }}-${{ matrix.tls }}

- uses: actions-rs/cargo@v1
with:
command: test
args: >
--features default,sqlx-${{ matrix.database }},runtime-${{ matrix.runtime }}-${{ matrix.tls }}
--no-run
- uses: actions-rs/cargo@v1
with:
command: build
args: >
--path examples/async-std
--manifest-path examples/async-std/Cargo.toml
- uses: actions-rs/cargo@v1
with:
command: build
args: >
--path examples/tokio
--manifest-path examples/tokio/Cargo.toml
sqlite:
name: SQLite
Expand Down

0 comments on commit 8cfa142

Please sign in to comment.