Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: CI: setup git repository properly #3373

Draft
wants to merge 2 commits into
base: subscription-manager-1.24
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,31 @@ jobs:
image: ${{ matrix.image }}

steps:
- name: "Enable EPEL repository"
run: |
yum -y install epel-release

- name: "Install core packages"
run: |
yum install -y \
git-core gcc make python python-devel python-setuptools python-pip

- name: "Checkout repository"
uses: actions/checkout@v3

# We need to initiate the repository manually because Actions fallback
# to REST API with Git < 2.18; CentOS 7/RHEL 7 have 1.8.
# See https://github.com/actions/checkout#checkout-v3
# See https://github.com/actions/checkout/issues/766
- name: "Initiate new git repository"
run: |
git config --global user.email "[email protected]"
git config --global user.name "RHSM for RHEL 7 at GitHub Actions"
git init
git add .
git commit -m "Detached commit"
git config --global --add safe.directory '*'

- name: "Run container-pre-test.sh"
run: |
bash scripts/container-pre-test.sh
Expand Down
6 changes: 0 additions & 6 deletions scripts/container-pre-test.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
#!/bin/bash

yum install -y epel-release

# Install essential packages
yum install -y \
git gcc make python python-devel python-setuptools python-pip

# Install system, build and runtime packages
yum install -y \
gtk3-devel python-ethtool \
Expand Down
3 changes: 2 additions & 1 deletion subscription-manager.spec
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,8 @@ Requires: virt-what
Requires: %{rhsm_package_name} = %{version}
Requires: %{py_package_prefix}-six
Requires: %{py_package_prefix}-dateutil
Requires: %{py_package_prefix}-syspurpose
Requires: %{py_package_prefix}-syspurpose
Requires: %{py_package_prefix}-requests

# rhel 8 has different naming for setuptools going forward
%if (0%{?rhel} && 0%{?rhel} >= 8)
Expand Down