Skip to content

Commit

Permalink
feat(ci): Add CI tests
Browse files Browse the repository at this point in the history
* Card ID: CCT-364

Start running our small test suite when PR is opened or updated.

(Adapted from 397fe6f)
  • Loading branch information
m-horky committed Feb 29, 2024
1 parent 0cf3463 commit 82d554d
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: pytest

on:
pull_request:
paths:
- "src/**"

jobs:
pytest:
strategy:
fail-fast: false
matrix:
include:
- name: "CentOS 7"
image: "quay.io/centos/centos:7"

runs-on: "ubuntu-latest"
container:
image: ${{ matrix.image }}

steps:
- name: "Checkout the repository"
uses: actions/checkout@v4

- name: "Install dependencies"
# We can't run 'pip install' over the core repo, pip 20 doesn't understand the 'extras_require' in its setup.py
run: |
yum install -y epel-release git-core
yum install -y python-pip
python -m pip install --upgrade 'pip<21'
python -m pip install -r src/insights_client/tests/requirements.txt
git clone https://github.com/RedHatInsights/insights-core.git /tmp/egg
- name: "Run pytest"
env:
PYTEST_ADDOPTS: "--color=yes --code-highlight=yes --showlocals"
PYTHONPATH: "src/:/tmp/egg/"
EGG: "/tmp/egg/"
BYPASS_GPG: "true"
run: |
python -m pytest src/insights_client/tests

0 comments on commit 82d554d

Please sign in to comment.