Skip to content

GitHub project folder update (QA standard) #6

GitHub project folder update (QA standard)

GitHub project folder update (QA standard) #6

Workflow file for this run

# Copyright 2024 ABSA Group Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name: CI Python
on:
pull_request:
jobs:
test-smallfiles:
name: Test Small files
runs-on: ubuntu-latest
defaults:
run:
working-directory: smallfiles
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
- name: Install dependencies
run: |
pip install -r requirements.txt
pip install coverage pytest
- name: Run tests
run: coverage run -m pytest test/
- name: Show coverage
run: coverage report -m --omit=".*.ipynb"
- name: Create coverage file
if: github.event_name == 'pull_request'
run: coverage xml
- name: Get Cover
if: github.event_name == 'pull_request'
uses: orgoro/[email protected]
with:
coverageFile: smallfiles/coverage.xml
token: ${{ secrets.GITHUB_TOKEN }}
thresholdAll: 0.7
thresholdNew: 0.9
- uses: actions/upload-artifact@v4
if: github.event_name == 'pull_request'
with:
name: coverage
path: coverage.xml
retention-days: 1
python-format-check:
name: Python Format Check
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
- name: Install dependencies
run: |
pip install black
- name: Check code format with Black
run: |
black --check $(git ls-files '*.py')
python-static-analysis:
name: Python Static Analysis
runs-on: ubuntu-latest
defaults:
run:
working-directory: smallfiles
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
- name: Install dependencies
run: |
pip install -r requirements.txt
pip install pylint
- name: Analysing the code with pylint
run: |
pylint $(git ls-files '*.py')