#56 #57 Update sonar cloud and codecov job #88
Workflow file for this run
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
name: Viot Tests and Linting | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- "viot/**" | |
- ".github/workflows/viot-test.yml" | |
pull_request: | |
branches: | |
- main | |
paths: | |
- "viot/**" | |
- ".github/workflows/viot-test.yml" | |
types: | |
- opened | |
- synchronize | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out Git repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: Install Poetry | |
run: | | |
pip install poetry | |
poetry config virtualenvs.create false | |
- name: Install dependencies | |
working-directory: ./viot | |
run: poetry install --no-interaction --no-root | |
- name: Lint | |
working-directory: ./viot | |
run: bash ./scripts/lint.sh | |
- name: Tests | |
working-directory: ./viot | |
run: bash ./scripts/test.sh --cov-report=xml | |
sonar: | |
needs: | |
- test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out Git repository | |
uses: actions/checkout@v4 | |
- name: SonarCloud Scan | |
uses: sonarsource/sonarcloud-github-action@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
codecov: | |
needs: | |
- test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out Git repository | |
uses: actions/checkout@v4 | |
- name: Upload results to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} |