Skip to content

Add skeleton for complete docs #17

Add skeleton for complete docs

Add skeleton for complete docs #17

Workflow file for this run

###
# ```{rubric} Coveralls Workflow
# ```
# ---
# Workflow configuration.
#
# ```{literalinclude} /.github/workflows/coveralls.yml
# :language: yaml
# :start-at: "on:\n"
# ```
on:
push:
branches:
- main
pull_request:
branches:
- main
name: Coveralls
jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@main
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@main
with:
python-version: ${{ matrix.python-version }}
- name: git config
run: |
git config user.username edwardtheharris
git config user.name 'Xander Harris'
git config user.email '[email protected]'
git checkout -b 123-feature-branch-test
- name: Install Dependencies
run: |
pip3 install -U pip pipenv
pipenv requirements --dev > reqs
pip3 install -r reqs
- name: Run tests with coverage
run: |
pytest --cov
pytest --junit-xml=results-${{ matrix.python-version }}.xml
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
check_name: pytest-${{ matrix.python-version }}
comment_title: "Pytest ${{ matrix.python-version }} Results"
files: results-${{ matrix.python-version }}.xml
- name: Coveralls
uses: coverallsapp/github-action@v2
with:
parallel: true
flag-name: run-${{ matrix.python-version }}
pylint:
name: PyLint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@main
with:
python-version: 3.11
- name: Install dependencies
run: |
python -m pip install -U pip pipenv
python -m pipenv requirements --dev > reqs
python -m pip install -r reqs
- name: Run PyLint
run: |
pylint **/*.py --output-format=pylint_junit.JUnitReporter --output=pylint.xml || true
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
check_name: pylint
comment_title: "PyLint Results"
files: pylint.xml
sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Setup Python
uses: actions/setup-python@main
with:
python-version: 3.11
- name: Run tox
run: |
python -m pip install -U pip pipenv
python -m pipenv requirements --dev > reqs
python -m pip install -r reqs
pytest --cov --cov-report=xml
pytest --cov
version="$(python -c 'from k8s_agent.__init__ import __version__; print(__version__)')"
sed -i -e "s/__version__/${version}/" sonar-project.properties
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
with:
args: >
-Dsonar.projectKey=edwardtheharris_k8s-operator-agent
-Dsonar.projectName=k8s-operator-agent
-Dsonar.verbose=true
projectBaseDir: .
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
finish:
needs: build
runs-on: ubuntu-latest
steps:
- name: Close parallel build
uses: coverallsapp/github-action@v1
with:
parallel-finished: true
carryforward: "run-3.8,run-3.9,run-3.10,run-3.11,run-3.12"