Build CI/CD Pipeline for GX Credential Generator #22
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
# This workflow will install Python dependencies, run tests and lint with a single version of Python | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | |
name: Check Python application | |
on: | |
push: | |
branches: | |
- "main" | |
pull_request: | |
branches: | |
- "main" | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip setuptools | |
pip install -r test-requirements.txt | |
pip install -r requirements.txt | |
#- name: Test with pytest | |
# run: | | |
# #pip install pytest pytest-cov | |
# python3 -m pytest tests --doctest-modules --junitxml=junit/test-results.xml | |
- name: Test with pytest | |
run: | | |
coverage run --omit=tests/*,generator/common/gx_schema.py,*__init__*,generator/vendor/* -m pytest tests | |
coverage xml | |
- name: Code Coverage Report | |
uses: codecov/codecov-action@v4 | |
with: | |
fail_ci_if_error: true # optional (default = false) | |
files: coverage.xml | |
flags: unittests # optional | |
name: codecov-umbrella # optional | |
token: ${{ secrets.CODECOV_TOKEN }} # required | |
verbose: true # optional (default = false) | |
#- name: Add Coverage PR Comment | |
# uses: marocchino/sticky-pull-request-comment@v2 | |
# if: github.event_name == 'pull_request' | |
# with: | |
# recreate: true | |
# path: code-coverage-results.md |