Skip to content

Commit

Permalink
CI: Fix mirrors and GHA verify workflow
Browse files Browse the repository at this point in the history
Use the latest version of lfit/[email protected]
and lfit/[email protected].

Mirrorlist URLs have been archived and moved to Cent OS vault.

https://forums.centos.org/viewtopic.php?t=78708&start=30
https://forums.centos.org/viewtopic.php?t=80698

This impacts configuration force vault use in yum repos config
till this is fixed upstream.

Change-Id: Ifcdbad718b61089df0a7a0d809f0fee9268d9782
Signed-off-by: Anil Belur <[email protected]>
  • Loading branch information
askb committed Sep 3, 2024
1 parent a86f063 commit be63c88
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 10 deletions.
33 changes: 24 additions & 9 deletions .github/workflows/gerrit-verify.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Clear votes
uses: lfit/[email protected]
# yamllint disable-line rule:line-length
uses: lfit/gerrit-review-action@9627b9a144f2a2cad70707ddfae87c87dce60729 v0.8
with:
host: ${{ vars.LFIT_GERRIT_SERVER }}
username: ${{ vars.LFIT_GERRIT_SSH_USER }}
Expand All @@ -60,16 +61,21 @@ jobs:
gerrit-change-number: ${{ inputs.GERRIT_CHANGE_NUMBER }}
gerrit-patchset-number: ${{ inputs.GERRIT_PATCHSET_NUMBER }}
vote-type: clear
comment-only: false
- name: Allow replication
run: sleep 10s

actionlint:
needs: prepare
runs-on: ubuntu-latest
steps:
- uses: lfit/[email protected]
- name: Gerrit Checkout
# yamllint disable-line rule:line-length
uses: lfit/checkout-gerrit-change-action@54d751e8bd167bc91f7d665dabe33fae87aaaa63 # v0.9
with:
gerrit-refspec: ${{ inputs.GERRIT_REFSPEC }}
gerrit-project: ${{ inputs.GERRIT_PROJECT }}
gerrit-url: ${{ vars.GERRIT_URL }}
delay: "0s"
- name: Download actionlint
id: get_actionlint
Expand All @@ -84,13 +90,17 @@ jobs:
needs: prepare
runs-on: ubuntu-latest
steps:
- uses: lfit/[email protected]
- name: Gerrit Checkout
# yamllint disable-line rule:line-length
uses: lfit/checkout-gerrit-change-action@54d751e8bd167bc91f7d665dabe33fae87aaaa63 # v0.9
with:
gerrit-refspec: ${{ inputs.GERRIT_REFSPEC }}
gerrit-project: ${{ inputs.GERRIT_PROJECT }}
gerrit-url: ${{ vars.GERRIT_URL }}
delay: "0s"
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: "3.8"
python-version: "3.10"
- name: Run static analysis and format checkers
run: pipx run pre-commit run --all-files --show-diff-on-failure

Expand All @@ -110,9 +120,11 @@ jobs:
steps:
- name: Gerrit Checkout
# yamllint disable-line rule:line-length
uses: lfit/checkout-gerrit-change-action@70360ca2f8bee3e6a15224d8a03f8e017b1ac91f # v0.4
uses: lfit/checkout-gerrit-change-action@54d751e8bd167bc91f7d665dabe33fae87aaaa63 # v0.9
with:
gerrit-refspec: ${{ inputs.GERRIT_REFSPEC }}
gerrit-project: ${{ inputs.GERRIT_PROJECT }}
gerrit-url: ${{ vars.GERRIT_URL }}
delay: "0s"
- name: Install test dependencies.
run: |
Expand All @@ -124,7 +136,7 @@ jobs:
env:
PY_COLORS: "1"
ANSIBLE_FORCE_COLOR: "1"
MOLECULE_DISTRO: ${{ matrix.distro }}
MOLECULE_PLATFORM_NAME: ${{ matrix.distro }}

vote:
if: ${{ always() }}
Expand All @@ -137,9 +149,11 @@ jobs:
]
runs-on: ubuntu-latest
steps:
- uses: technote-space/workflow-conclusion-action@v3
- name: Get conclusion
# yamllint disable-line rule:line-length
uses: im-open/workflow-conclusion@e4f7c4980600fbe0818173e30931d3550801b992 # v2.2.3
- name: Set vote
uses: lfit/gerrit-review-action@v0.3
uses: lfit/gerrit-review-action@9627b9a144f2a2cad70707ddfae87c87dce60729 # v0.8
with:
host: ${{ vars.LFIT_GERRIT_SERVER }}
username: ${{ vars.LFIT_GERRIT_SSH_USER }}
Expand All @@ -148,3 +162,4 @@ jobs:
gerrit-change-number: ${{ inputs.GERRIT_CHANGE_NUMBER }}
gerrit-patchset-number: ${{ inputs.GERRIT_PATCHSET_NUMBER }}
vote-type: ${{ env.WORKFLOW_CONCLUSION }}
comment-only: false
21 changes: 21 additions & 0 deletions molecule/default/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,27 @@
key: https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-8
when: ansible_os_family == 'RedHat'
become: true

- name: Re-configure yum repositories for CentOS 7 and 8 to point to vault
become: true
when:
- (ansible_distribution == 'CentOS' and ansible_distribution_major_version == '8') or
(ansible_distribution == 'CentOS' and ansible_distribution_major_version == '7')
block:
- name: Disable default CentOS mirrors (backup original)
ansible.builtin.lineinfile:
path: /etc/yum.repos.d/CentOS-*
regexp: '^mirrorlist'
replace: '#mirrorlist'
backup: yes

- name: Update CentOS mirrors to vault.centos.org (backup original)
ansible.builtin.lineinfile:
path: /etc/yum.repos.d/CentOS-*
regexp: '^baseurl=http://mirror.centos.org'
replace: 'baseurl=http://vault.centos.org'
backup: yes

- name: Install Fedora EPEL repo
ansible.builtin.yum:
name: https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ ansible_distribution_major_version }}.noarch.rpm
Expand Down
2 changes: 1 addition & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
- '{{ ansible_os_family }}.yml'

- name: Install Python
become: true
ansible.builtin.package:
name: '{{ python_packages }}'
state: present
become: true

- name: Pre-set python versions required for pyenv global command
block:
Expand Down

0 comments on commit be63c88

Please sign in to comment.