Skip to content

Git Commit Reader

Git Commit Reader #111

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
env:
PYTHON_VERSION: '3.10'
POETRY_VERSION: '1.8.2'
jobs:
code-quality:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install Poetry
run: pipx install poetry==1.8.2
- name: Install Dev Deps
id: install
run: poetry install --only=dev
- name: Ruff Lint
if: steps.install.outcome == 'success'
id: ruff-lint
run: |
poetry run ruff check > ruff-lint.log
ruff_check_exit_code=$?
cat ruff-lint.log
exit $ruff_check_exit_code
- name: Ruff Format
if: always() && steps.install.outcome == 'success'
id: ruff-format
run: |
set -o pipefail
poetry run ruff format --check 2>&1 | tee ruff-format.log
- name: Post Summary
if: always()
run: |
echo "### Ruff Lint Results" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
LINT_LOG=$(cat ruff-lint.log || echo "No lint log found.")
echo "$LINT_LOG" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
echo "### Ruff Format Results" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
FORMAT_LOG=$(cat ruff-format.log || echo "No format log found.")
echo "$FORMAT_LOG" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
unit-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install Poetry
run: pipx install poetry==1.8.2
- name: Install Dev Deps
id: install
run: poetry install --only=dev
- name: Run Pytest
if: steps.install.outcome == 'success'
run: |
set -o pipefail
poetry run pytest -v --disable-warnings 2>&1 | tee pytest.log
- name: Post Summary
if: always()
run: |
echo "### Pytest Results" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
TEST_LOG=$(cat pytest.log || echo "No test log found.")
echo "$TEST_LOG" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
integrations-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install Poetry
run: pipx install poetry==1.8.2
- name: Run Poetry Lock
run: poetry lock
- name: Install comeit
id: install
run: poetry install
- name: Run comeit Sanity
run: poetry run comeit --help
- name: Run Comeit
if: steps.install.outcome == 'success'
run: |
set -o pipefail
poetry run comeit 2>&1 | tee comeit.log
- name: Post Summary
if: always()
run: |
echo "### Comeit Results" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
COMEIT_LOG=$(cat comeit.log || echo "No comeit log found.")
echo "$COMEIT_LOG" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY