Add more testing configuration #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
name: CI | |
on: | |
workflow_dispatch: | |
push: | |
branches: [main, initial] | |
pull_request: | |
branches: [main, initial] | |
jobs: | |
workflow: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
# super-linter needs the full git history to get the | |
# list of files that changed across commits | |
fetch-depth: 0 | |
- name: Super-linter | |
uses: super-linter/[email protected] # x-release-please-version | |
env: | |
# To report GitHub Actions status checks | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
VALIDATE_CHECKOV: false | |
VALIDATE_MARKDOWN: false | |
VALIDATE_GITHUB_ACTIONS: false | |
VALIDATE_PYTHON_PYLINT: false | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Build | |
run: | | |
python -m pip install --upgrade pip | |
pip install . .[test] | |
- name: Tests | |
run: | | |
pytest --cov=${PWD}/hcp_vault_secrets_client --cov-report xml:coverage.xml tests/unit | |
- name: fix code coverage paths | |
run: | | |
sed -i 's/\/home\/runner\/work\/hcp-vault-secrets-client\/hcp-vault-secrets-client\//\/github\/workspace\//g' coverage.xml | |
- name: SonarCloud Scan | |
uses: SonarSource/sonarcloud-github-action@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |