-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #80 from kana-rus/use_taskfile_in_ci
FIX: README format, Taskfile, workflows
- Loading branch information
Showing
7 changed files
with
131 additions
and
141 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: CI | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
CI: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
toolchain: ['stable', 'nightly'] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install task command | ||
run: sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin | ||
|
||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: ${{ matrix.toolchain }} | ||
profile: minimal | ||
override: true | ||
|
||
- name: Cache cargo tools | ||
id: cache_cargo_tools | ||
uses: actions/cache@v3 | ||
with: | ||
key: ${{ runner.os }}-cargo-install | ||
path: ~/.cargo/bin | ||
- name: Install cargo tools | ||
if: ${{ steps.cache_cargo_tools.outputs.cache-hit != 'true' }} | ||
run: cargo install sqlx-cli --no-default-features --features native-tls,postgres | ||
|
||
- name: Run tasks | ||
run: task test check ${{ matrix.toolchain == 'nightly' && 'bench' || '' }} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,93 @@ | ||
version: '3' | ||
|
||
tasks: | ||
test_rt_async-std: | ||
test: | ||
deps: | ||
- test_doc | ||
- test_rt_tokio | ||
- test_rt_tokio_with_custom-header | ||
- test_rt_async-std | ||
- test_rt_async-std_with_custom-header | ||
- test_examples | ||
|
||
check: | ||
deps: | ||
- check_rt_tokio | ||
- check_rt_async-std | ||
|
||
bench: | ||
dir: benches | ||
cmds: | ||
- cargo bench | ||
|
||
#### tests #### | ||
test_doc: | ||
dir: ohkami | ||
cmds: | ||
- cargo test --no-default-features --features rt_tokio | ||
- cargo test --no-default-features --features rt_tokio,utils | ||
- cargo test --no-default-features --features rt_tokio,testing | ||
- cargo test --no-default-features --features rt_tokio,utils,testing | ||
- cargo test --no-default-features --features custom-header,rt_tokio | ||
- cargo test --no-default-features --features custom-header,rt_tokio,utils | ||
- cargo test --no-default-features --features custom-header,rt_tokio,testing | ||
- cargo test --no-default-features --features custom-header,rt_tokio,utils,testing | ||
- cargo test --doc --features DEBUG,rt_tokio | ||
- cargo test --doc --features DEBUG,rt_tokio,custom-header | ||
|
||
test_rt_tokio: | ||
dir: ohkami | ||
cmds: | ||
- cargo test --lib --no-default-features --features DEBUG,rt_tokio | ||
- cargo test --lib --no-default-features --features DEBUG,rt_tokio,utils | ||
- cargo test --lib --no-default-features --features DEBUG,rt_tokio,testing | ||
- cargo test --lib --no-default-features --features DEBUG,rt_tokio,utils,testing | ||
test_rt_tokio_with_custom-header: | ||
dir: ohkami | ||
cmds: | ||
- cargo test --lib --no-default-features --features DEBUG,custom-header,rt_tokio | ||
- cargo test --lib --no-default-features --features DEBUG,custom-header,rt_tokio,utils | ||
- cargo test --lib --no-default-features --features DEBUG,custom-header,rt_tokio,testing | ||
- cargo test --lib --no-default-features --features DEBUG,custom-header,rt_tokio,utils,testing | ||
|
||
test_rt_async-std: | ||
dir: ohkami | ||
cmds: | ||
- cargo test --lib --no-default-features --features DEBUG,rt_async-std | ||
- cargo test --lib --no-default-features --features DEBUG,rt_async-std,utils | ||
- cargo test --lib --no-default-features --features DEBUG,rt_async-std,testing | ||
- cargo test --lib --no-default-features --features DEBUG,rt_async-std,utils,testing | ||
test_rt_async-std_with_custom-header: | ||
dir: ohkami | ||
cmds: | ||
- cargo test --lib --no-default-features --features DEBUG,custom-header,rt_async-std | ||
- cargo test --lib --no-default-features --features DEBUG,custom-header,rt_async-std,utils | ||
- cargo test --lib --no-default-features --features DEBUG,custom-header,rt_async-std,testing | ||
- cargo test --lib --no-default-features --features DEBUG,custom-header,rt_async-std,utils,testing | ||
|
||
test_examples: | ||
dir: examples | ||
cmds: | ||
- docker compose -f ./realworld/docker-compose.yml up -d | ||
- cd ./realworld && sleep 5 && sqlx migrate run | ||
- cargo test | ||
- docker compose -f ./realworld/docker-compose.yml down | ||
|
||
#### checks #### | ||
# Assure buildability without "DEBUG" feature | ||
|
||
check_rt_tokio: | ||
dir: ohkami | ||
cmds: | ||
- cargo check --lib --no-default-features --features rt_tokio | ||
- cargo check --lib --no-default-features --features rt_tokio,utils | ||
- cargo check --lib --no-default-features --features rt_tokio,testing | ||
- cargo check --lib --no-default-features --features rt_tokio,utils,testing | ||
- cargo check --lib --no-default-features --features custom-header,rt_tokio | ||
- cargo check --lib --no-default-features --features custom-header,rt_tokio,utils | ||
- cargo check --lib --no-default-features --features custom-header,rt_tokio,testing | ||
- cargo check --lib --no-default-features --features custom-header,rt_tokio,utils,testing | ||
|
||
check_rt_async-std: | ||
dir: ohkami | ||
cmds: | ||
- cargo test --no-default-features --features rt_async-std | ||
- cargo test --no-default-features --features rt_async-std,utils | ||
- cargo test --no-default-features --features rt_async-std,testing | ||
- cargo test --no-default-features --features rt_async-std,utils,testing | ||
- cargo test --no-default-features --features custom-header,rt_async-std | ||
- cargo test --no-default-features --features custom-header,rt_async-std,utils | ||
- cargo test --no-default-features --features custom-header,rt_async-std,testing | ||
- cargo test --no-default-features --features custom-header,rt_async-std,utils,testing | ||
- cargo check --lib --no-default-features --features rt_async-std | ||
- cargo check --lib --no-default-features --features rt_async-std,utils | ||
- cargo check --lib --no-default-features --features rt_async-std,testing | ||
- cargo check --lib --no-default-features --features rt_async-std,utils,testing | ||
- cargo check --lib --no-default-features --features custom-header,rt_async-std | ||
- cargo check --lib --no-default-features --features custom-header,rt_async-std,utils | ||
- cargo check --lib --no-default-features --features custom-header,rt_async-std,testing | ||
- cargo check --lib --no-default-features --features custom-header,rt_async-std,utils,testing |
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
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