Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/code-check.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Python code checks
name: Code quality checks

on:
workflow_call:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run integration tests
name: Integration tests
on:
workflow_dispatch:
workflow_call:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ jobs:
uses: ./.github/workflows/code-check.yml
unit-tests:
uses: ./.github/workflows/unit-tests.yml
secrets:
GIST_PAT: ${{ secrets.GIST_PAT }}

security-scan:
needs: [unit-tests]
uses: ./.github/workflows/security-scan.yml
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ name: Unit tests

on:
workflow_call:
secrets:
GIST_PAT:
required: true
push:
branches: [ main ]

Expand Down Expand Up @@ -36,3 +39,27 @@ jobs:
with:
name: pytest-coverage-report
path: coverage.xml

- name: Extract coverage percent
id: coverage
if: github.event_name == 'push'
continue-on-error: true
run: |
fraction=$(sed -n 2p coverage.xml | sed 's/.*line-rate=\"\([0-9.]*\)\".*$/\1/')
percentage=$(echo "scale=1; $fraction * 100" | bc -l)
percentage_whole=$(echo "${percentage%.*}")
colour=$(if [ $percentage_whole -ge 80 ]; then echo "green"; else echo "orange"; fi)
echo "::set-output name=colour::$colour"
echo "::set-output name=covered::$percentage_whole"

- name: Create Coverage Badge
uses: schneegans/dynamic-badges-action@v1.2.0
if: github.event_name == 'push'
continue-on-error: true
with:
auth: ${{ secrets.GIST_PAT }}
gistID: 65d5a42849fd78f4c6e62fad18490d20
filename: firebolt-sdk-coverage.json
label: Coverage
message: ${{steps.coverage.outputs.covered}}%
color: ${{steps.coverage.outputs.colour}}
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
# firebolt-sdk
[![Nightly code check](https://github.com/firebolt-db/firebolt-python-sdk/actions/workflows/nightly.yml/badge.svg)](https://github.com/firebolt-db/firebolt-python-sdk/actions/workflows/nightly.yml)
[![Unit tests](https://github.com/firebolt-db/firebolt-python-sdk/actions/workflows/unit-tests.yml/badge.svg)](https://github.com/firebolt-db/firebolt-python-sdk/actions/workflows/unit-tests.yml)
[![Code quality checks](https://github.com/firebolt-db/firebolt-python-sdk/actions/workflows/code-check.yml/badge.svg)](https://github.com/firebolt-db/firebolt-python-sdk/actions/workflows/code-check.yml)
[![Firebolt Security Scan](https://github.com/firebolt-db/firebolt-python-sdk/actions/workflows/security-scan.yml/badge.svg)](https://github.com/firebolt-db/firebolt-python-sdk/actions/workflows/security-scan.yml)
[![Integration tests](https://github.com/firebolt-db/firebolt-python-sdk/actions/workflows/integration-tests.yml/badge.svg)](https://github.com/firebolt-db/firebolt-python-sdk/actions/workflows/integration-tests.yml)
![Coverage](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/ptiurin/65d5a42849fd78f4c6e62fad18490d20/raw/firebolt-sdk-coverage.json)


### Installation

* Requires Python `>=3.7`
Expand Down