Auto discover and run all issues & examples CI (#903)
* Auto discover and run all [issues] CI * Auto discover and run all examples CI * Fixup * Testing * Test [issues]
This commit is contained in:
parent
1385b749cb
commit
41116499e0
133
.github/workflows/rust.yml
vendored
133
.github/workflows/rust.yml
vendored
@ -64,7 +64,7 @@ jobs:
|
|||||||
|
|
||||||
init:
|
init:
|
||||||
name: Init
|
name: Init
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
outputs:
|
||||||
run-sqlite: ${{ contains(steps.git-log.outputs.message, '[sqlite]') }}
|
run-sqlite: ${{ contains(steps.git-log.outputs.message, '[sqlite]') }}
|
||||||
run-mysql: ${{ contains(steps.git-log.outputs.message, '[mysql]') }}
|
run-mysql: ${{ contains(steps.git-log.outputs.message, '[mysql]') }}
|
||||||
@ -89,7 +89,7 @@ jobs:
|
|||||||
|
|
||||||
clippy:
|
clippy:
|
||||||
name: Clippy
|
name: Clippy
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
@ -144,8 +144,9 @@ jobs:
|
|||||||
needs.init.outputs.run-partial == 'false' ||
|
needs.init.outputs.run-partial == 'false' ||
|
||||||
(needs.init.outputs.run-partial == 'true' && needs.init.outputs.run-sqlite == 'true')
|
(needs.init.outputs.run-partial == 'true' && needs.init.outputs.run-sqlite == 'true')
|
||||||
}}
|
}}
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
runtime: [async-std]
|
runtime: [async-std]
|
||||||
tls: [native-tls, rustls]
|
tls: [native-tls, rustls]
|
||||||
@ -183,8 +184,9 @@ jobs:
|
|||||||
needs.init.outputs.run-partial == 'false' ||
|
needs.init.outputs.run-partial == 'false' ||
|
||||||
(needs.init.outputs.run-partial == 'true' && needs.init.outputs.run-mysql == 'true')
|
(needs.init.outputs.run-partial == 'true' && needs.init.outputs.run-mysql == 'true')
|
||||||
}}
|
}}
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
runtime: [actix]
|
runtime: [actix]
|
||||||
tls: [native-tls, rustls]
|
tls: [native-tls, rustls]
|
||||||
@ -222,8 +224,9 @@ jobs:
|
|||||||
needs.init.outputs.run-partial == 'false' ||
|
needs.init.outputs.run-partial == 'false' ||
|
||||||
(needs.init.outputs.run-partial == 'true' && needs.init.outputs.run-postgres == 'true')
|
(needs.init.outputs.run-partial == 'true' && needs.init.outputs.run-postgres == 'true')
|
||||||
}}
|
}}
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
runtime: [tokio]
|
runtime: [tokio]
|
||||||
tls: [native-tls, rustls]
|
tls: [native-tls, rustls]
|
||||||
@ -255,7 +258,7 @@ jobs:
|
|||||||
|
|
||||||
test:
|
test:
|
||||||
name: Unit Test
|
name: Unit Test
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
@ -287,10 +290,7 @@ jobs:
|
|||||||
name: CLI
|
name: CLI
|
||||||
needs: init
|
needs: init
|
||||||
if: ${{ (needs.init.outputs.run-partial == 'true' && needs.init.outputs.run-cli == 'true') }}
|
if: ${{ (needs.init.outputs.run-partial == 'true' && needs.init.outputs.run-cli == 'true') }}
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
os: [ubuntu-latest]
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
@ -307,14 +307,26 @@ jobs:
|
|||||||
--path sea-orm-cli
|
--path sea-orm-cli
|
||||||
--debug
|
--debug
|
||||||
|
|
||||||
|
examples-matrix:
|
||||||
|
name: Examples Matrix
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- id: set-matrix
|
||||||
|
run: echo "::set-output name=path_matrix::$(find examples -type f -name 'Cargo.toml' -printf '%P\0' | jq -Rc '[ split("\u0000") | .[] | "examples/\(.)" ]')"
|
||||||
|
outputs:
|
||||||
|
path_matrix: ${{ steps.set-matrix.outputs.path_matrix }}
|
||||||
|
|
||||||
examples:
|
examples:
|
||||||
name: Examples
|
name: Examples
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ubuntu-latest
|
||||||
|
needs: examples-matrix
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
|
max-parallel: 12
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest]
|
path: ${{ fromJson(needs.examples-matrix.outputs.path_matrix) }}
|
||||||
path: [basic, actix_example, actix3_example, axum_example, graphql_example, rocket_example, poem_example, jsonrpsee_example, tonic_example]
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
@ -328,51 +340,58 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
command: build
|
command: build
|
||||||
args: >
|
args: >
|
||||||
--manifest-path examples/${{ matrix.path }}/Cargo.toml
|
--manifest-path ${{ matrix.path }}
|
||||||
|
|
||||||
- name: Check existence of migration directory
|
|
||||||
id: migration_dir_exists
|
|
||||||
uses: andstor/file-existence-action@v1
|
|
||||||
with:
|
|
||||||
files: examples/${{ matrix.path }}/migration/Cargo.toml
|
|
||||||
|
|
||||||
- uses: actions-rs/cargo@v1
|
|
||||||
if: steps.migration_dir_exists.outputs.files_exists == 'true'
|
|
||||||
with:
|
|
||||||
command: build
|
|
||||||
args: >
|
|
||||||
--manifest-path examples/${{ matrix.path }}/migration/Cargo.toml
|
|
||||||
|
|
||||||
issues:
|
|
||||||
name: Issues
|
|
||||||
needs: init
|
|
||||||
if: ${{ (needs.init.outputs.run-partial == 'true' && needs.init.outputs.run-issues == 'true') }}
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os: [ubuntu-latest]
|
|
||||||
path: [86, 249, 262, 319, 324, 352, 356, 471, 630, 693]
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- uses: actions-rs/toolchain@v1
|
|
||||||
with:
|
|
||||||
profile: minimal
|
|
||||||
toolchain: stable
|
|
||||||
override: true
|
|
||||||
|
|
||||||
- uses: actions-rs/cargo@v1
|
|
||||||
with:
|
|
||||||
command: build
|
|
||||||
args: >
|
|
||||||
--manifest-path issues/${{ matrix.path }}/Cargo.toml
|
|
||||||
|
|
||||||
- uses: actions-rs/cargo@v1
|
- uses: actions-rs/cargo@v1
|
||||||
with:
|
with:
|
||||||
command: test
|
command: test
|
||||||
args: >
|
args: >
|
||||||
--manifest-path issues/${{ matrix.path }}/Cargo.toml
|
--manifest-path ${{ matrix.path }}
|
||||||
|
|
||||||
|
issues-matrix:
|
||||||
|
name: Issues Matrix
|
||||||
|
needs: init
|
||||||
|
if: ${{ (needs.init.outputs.run-partial == 'true' && needs.init.outputs.run-issues == 'true') }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- id: set-matrix
|
||||||
|
run: echo "::set-output name=path_matrix::$(find issues -type f -name 'Cargo.toml' -printf '%P\0' | jq -Rc '[ split("\u0000") | .[] | "issues/\(.)" ]')"
|
||||||
|
outputs:
|
||||||
|
path_matrix: ${{ steps.set-matrix.outputs.path_matrix }}
|
||||||
|
|
||||||
|
issues:
|
||||||
|
name: Issues
|
||||||
|
needs:
|
||||||
|
- init
|
||||||
|
- issues-matrix
|
||||||
|
if: ${{ (needs.init.outputs.run-partial == 'true' && needs.init.outputs.run-issues == 'true') }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
path: ${{ fromJson(needs.issues-matrix.outputs.path_matrix) }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- uses: actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
profile: minimal
|
||||||
|
toolchain: stable
|
||||||
|
override: true
|
||||||
|
|
||||||
|
- uses: actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: build
|
||||||
|
args: >
|
||||||
|
--manifest-path ${{ matrix.path }}
|
||||||
|
|
||||||
|
- uses: actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: test
|
||||||
|
args: >
|
||||||
|
--manifest-path ${{ matrix.path }}
|
||||||
|
|
||||||
sqlite:
|
sqlite:
|
||||||
name: SQLite
|
name: SQLite
|
||||||
@ -384,7 +403,7 @@ jobs:
|
|||||||
needs.init.outputs.run-partial == 'false' ||
|
needs.init.outputs.run-partial == 'false' ||
|
||||||
(needs.init.outputs.run-partial == 'true' && needs.init.outputs.run-sqlite == 'true')
|
(needs.init.outputs.run-partial == 'true' && needs.init.outputs.run-sqlite == 'true')
|
||||||
}}
|
}}
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
DATABASE_URL: "sqlite::memory:"
|
DATABASE_URL: "sqlite::memory:"
|
||||||
strategy:
|
strategy:
|
||||||
@ -435,7 +454,7 @@ jobs:
|
|||||||
needs.init.outputs.run-partial == 'false' ||
|
needs.init.outputs.run-partial == 'false' ||
|
||||||
(needs.init.outputs.run-partial == 'true' && needs.init.outputs.run-mysql == 'true')
|
(needs.init.outputs.run-partial == 'true' && needs.init.outputs.run-mysql == 'true')
|
||||||
}}
|
}}
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
DATABASE_URL: "mysql://root:@localhost"
|
DATABASE_URL: "mysql://root:@localhost"
|
||||||
strategy:
|
strategy:
|
||||||
@ -504,7 +523,7 @@ jobs:
|
|||||||
needs.init.outputs.run-partial == 'false' ||
|
needs.init.outputs.run-partial == 'false' ||
|
||||||
(needs.init.outputs.run-partial == 'true' && needs.init.outputs.run-mysql == 'true')
|
(needs.init.outputs.run-partial == 'true' && needs.init.outputs.run-mysql == 'true')
|
||||||
}}
|
}}
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
DATABASE_URL: "mysql://root:@localhost"
|
DATABASE_URL: "mysql://root:@localhost"
|
||||||
strategy:
|
strategy:
|
||||||
@ -565,7 +584,7 @@ jobs:
|
|||||||
needs.init.outputs.run-partial == 'false' ||
|
needs.init.outputs.run-partial == 'false' ||
|
||||||
(needs.init.outputs.run-partial == 'true' && needs.init.outputs.run-postgres == 'true')
|
(needs.init.outputs.run-partial == 'true' && needs.init.outputs.run-postgres == 'true')
|
||||||
}}
|
}}
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
DATABASE_URL: "postgres://root:root@localhost"
|
DATABASE_URL: "postgres://root:root@localhost"
|
||||||
strategy:
|
strategy:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user