-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(github-actions): add new workflow coverage: format, clippy and cov…
…erage
- Loading branch information
1 parent
6352e6d
commit dfe6c05
Showing
7 changed files
with
130 additions
and
6 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,58 @@ | ||
name: Coveralls | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
get-taos-version: | ||
runs-on: ubuntu-latest | ||
|
||
outputs: | ||
taos-version: ${{ steps.gettaosversion.outputs.version }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Get taos version | ||
id: gettaosversion | ||
run: echo "version=$(cat TAOSVERSION)" >> $GITHUB_OUTPUT | ||
|
||
coverage: | ||
needs: get-taos-version | ||
runs-on: ubuntu-latest | ||
|
||
services: | ||
tdengine: | ||
image: tdengine/tdengine:${{ needs.get-taos-version.outputs.taos-version }} | ||
ports: | ||
- 6030:6030 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: dtolnay/rust-toolchain@nightly | ||
|
||
- uses: taiki-e/install-action@cargo-tarpaulin | ||
|
||
- name: Cache taosc | ||
id: cache-taosc | ||
uses: actions/cache@v3 | ||
with: | ||
key: taosc-${{ needs.get-taos-version.outputs.taos-version }} | ||
path: TDengine-client-${{ needs.get-taos-version.outputs.taos-version }} | ||
|
||
- if: ${{ steps.cache-taosc.outputs.cache-hit != 'true' }} | ||
name: Get taosc | ||
run: | | ||
curl -sO https://www.taosdata.com/assets-download/3.0/TDengine-client-${{ needs.get-taos-version.outputs.taos-version }}-Linux-x64-Lite.tar.gz | ||
tar zxf TDengine-client-${{ needs.get-taos-version.outputs.taos-version }}-Linux-x64-Lite.tar.gz | ||
- name: Install taosc | ||
run: | | ||
cd TDengine-client-${{ needs.get-taos-version.outputs.taos-version}} | ||
./install_client.sh | ||
- name: Coverage | ||
run: cargo +nightly tarpaulin --follow-exec --post-test-delay 10 --coveralls ${{ secrets.COVERALLS_REPO_TOKEN }} -- --test-threads=1 |
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,64 @@ | ||
name: Tests | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize] | ||
|
||
jobs: | ||
get-taos-version: | ||
runs-on: ubuntu-latest | ||
|
||
outputs: | ||
taos-version: ${{ steps.gettaosversion.outputs.version }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Get taos version | ||
id: gettaosversion | ||
run: echo "version=$(cat TAOSVERSION)" >> $GITHUB_OUTPUT | ||
|
||
tests: | ||
needs: get-taos-version | ||
runs-on: ubuntu-latest | ||
|
||
services: | ||
tdengine: | ||
image: tdengine/tdengine:${{ needs.get-taos-version.outputs.taos-version }} | ||
ports: | ||
- 6030:6030 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Cache taosc | ||
id: cache-taosc | ||
uses: actions/cache@v3 | ||
with: | ||
key: taosc-${{ needs.get-taos-version.outputs.taos-version }} | ||
path: TDengine-client-${{ needs.get-taos-version.outputs.taos-version }} | ||
|
||
- if: ${{ steps.cache-taosc.outputs.cache-hit != 'true' }} | ||
name: Get taosc | ||
run: | | ||
curl -sO https://www.taosdata.com/assets-download/3.0/TDengine-client-${{ needs.get-taos-version.outputs.taos-version }}-Linux-x64-Lite.tar.gz | ||
tar zxf TDengine-client-${{ needs.get-taos-version.outputs.taos-version }}-Linux-x64-Lite.tar.gz | ||
- name: Install taosc | ||
run: | | ||
cd TDengine-client-${{ needs.get-taos-version.outputs.taos-version}} | ||
./install_client.sh | ||
- name: Install Rust toolchain | ||
uses: dtolnay/rust-toolchain@nightly | ||
with: | ||
components: rustfmt, clippy | ||
|
||
- name: Check format | ||
run: cargo fmt --check --all | ||
|
||
- name: Check clippy | ||
run: cargo clippy --all-targets --all-features -- -D warnings | ||
|
||
- name: Test | ||
run: cargo test -- --test-threads=1 |
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 |
---|---|---|
|
@@ -3,6 +3,7 @@ members = [ | |
"cml-core", | ||
"cml-tdengine", | ||
] | ||
resolver = "2" | ||
|
||
[workspace.dependencies] | ||
anyhow = "1" | ||
|
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 @@ | ||
3.0.7.1 |
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
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