ci: add pr codecov config (#69) #86
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
# Triggered by pull request or push to develop branch | |
# Test TypeScript rest connector. | |
name: nodejs Release | |
on: | |
push: | |
branches: ['main'] | |
pull_request: | |
branches: ['main'] | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
node-version: [14.x,16.x] | |
steps: | |
- name: Build Tools | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y build-essential cmake | |
sudo apt-get install -y python3 python3-pip python-is-python3 | |
- name: Checkout TDengine | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
repository: 'taosdata/TDengine' | |
path: 'TDengine' | |
ref: 'main' | |
submodules: 'recursive' | |
- name: install TDengine | |
run: | | |
cd TDengine | |
mkdir debug | |
cd debug | |
cmake .. -DBUILD_HTTP=false -DBUILD_JDBC=false -DBUILD_TOOLS=false -DBUILD_TEST=off -DBUILD_DEPENDENCY_TESTS=false | |
make -j 4 | |
sudo make install | |
which taosd | |
which taosadapter | |
- name: start taosd | |
run: | | |
nohup sudo taosd & | |
- name: start taosadapter | |
run: | | |
nohup sudo taosadapter & | |
- uses: actions/checkout@v3 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: test nodejs websocket | |
working-directory: nodejs | |
run: | | |
ls -al | |
npm install | |
npm list | |
npm run example | |
npm run test | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
fail_ci_if_error: false | |
files: coverage/lcov.info | |
verbose: true | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |