CI Publish Package #20
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
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 }} | |
- uses: Gr1N/setup-poetry@v9 | |
with: | |
poetry-version: ${{ env.POETRY_VERSION }} | |
- uses: actions/cache@v4 | |
with: | |
path: ~/.cache/pypoetry/virtualenvs | |
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }} | |
- run: poetry --version | |
- name: Install dev dependencies | |
id: install | |
run: poetry install # Install all dependencies including 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 }} | |
- uses: Gr1N/setup-poetry@v9 | |
with: | |
poetry-version: ${{ env.POETRY_VERSION }} | |
- uses: actions/cache@v4 | |
with: | |
path: ~/.cache/pypoetry/virtualenvs | |
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }} | |
- run: poetry --version | |
- name: Install dependencies | |
id: install | |
run: poetry install # Install all dependencies including dev | |
- name: Run Pytest | |
if: steps.install.outcome == 'success' | |
run: | | |
set -o pipefail | |
poetry run pytest --maxfail=5 --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 }} | |
- uses: Gr1N/setup-poetry@v9 | |
with: | |
poetry-version: ${{ env.POETRY_VERSION }} | |
- uses: actions/cache@v4 | |
with: | |
path: ~/.cache/pypoetry/virtualenvs | |
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }} | |
- run: poetry --version | |
- name: Run Poetry Lock | |
run: poetry lock | |
- name: Install dependencies | |
id: install | |
run: poetry install # Install all dependencies including dev | |
- 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 |