Skip to content

feat: [AAP-32189] Collect event streams used by each activation #4799

feat: [AAP-32189] Collect event streams used by each activation

feat: [AAP-32189] Collect event streams used by each activation #4799

Workflow file for this run

name: CI
env:
POETRY_NO_INTERACTION: 1
on:
push:
branches: [ 'main' ]
pull_request:
merge_group:
branches: [ 'main' ]
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install poetry
run: pipx install poetry
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: 'poetry'
- name: Install dependencies
run: poetry install --no-root --only=lint
- name: Lint with black
run: poetry run black --check -- .
- name: Lint with isort
run: poetry run isort --check -- .
- name: Lint with ruff
run: poetry run ruff --show-source -- .
- name: Lint with flake8
run: poetry run flake8 . --count --show-source --statistics
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- "3.11"
- "3.12"
env:
EDA_SECRET_KEY: 'test'
EDA_DB_PASSWORD: 'secret'
services:
postgres:
image: 'quay.io/sclorg/postgresql-15-c9s:latest'
env:
POSTGRESQL_USER: eda
POSTGRESQL_PASSWORD: secret
POSTGRESQL_ADMIN_PASSWORD: secret
POSTGRESQL_DATABASE: eda
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- '5432:5432'
redis: # Add this section for Redis
image: 'quay.io/fedora/redis-6:latest'
ports:
- '6379:6379'
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install poetry
run: pipx install poetry
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'
- name: Install package
run: poetry install -E all --only main,test
- name: Check migrations are up to date
run: poetry run /usr/bin/env aap-eda-manage makemigrations --dry-run --check
- name: Run tests
run: |
poetry run python -m pytest -vv --cov=./ --cov-report=xml --junit-xml=eda-server-test-results.xml
echo "GIT_SHA=$(git rev-parse "$GITHUB_SHA")" >> "$GITHUB_ENV"
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
env_vars: OS,PYTHON
fail_ci_if_error: false
files: ./coverage.xml
flags: "unit-int-tests-${{ matrix.python-version }}"
name: codecov-umbrella
verbose: true
- name: Upload jUnit test results (APDE CI)
if: github.repository == 'ansible/eda-server' && github.ref == 'refs/heads/main'
run: >-
poetry run http --check-status --ignore-stdin
--auth "${{ vars.PDE_ORG_RESULTS_AGGREGATOR_UPLOAD_USER }}:${{ secrets.PDE_ORG_RESULTS_UPLOAD_PASSWORD }}"
-f POST "${{ vars.PDE_ORG_RESULTS_AGGREGATOR_UPLOAD_URL }}/api/results/upload/"
[email protected]
component_name=eda
git_commit_sha=${{ env.GIT_SHA }}
git_repository_url="https://github.com/${{ github.repository }}"