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

Test failure #3

Open
wants to merge 3 commits into
base: rhel-9
Choose a base branch
from
Open
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
103 changes: 103 additions & 0 deletions .github/workflows/template-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# Test if the committed files match templates.
# This checks each commit sequentially, so each commit must be correct.

name: Template check
on:
pull_request

permissions:
contents: read
pull-requests: write

jobs:
infra-reload-check:
runs-on: ubuntu-20.04
name: Templates match results

steps:
- name: Clone Anaconda repository
uses: actions/checkout@v4
with:
# TODO: Are we able to remove ref, fetch-depth and Rebase task? Seems that the checkout
# without ref is doing the rebase for us.
# otherwise we are testing target branch instead of the PR branch (see pull_request_target trigger)
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0

- name: Rebase to current
run: |
git config user.name github-actions
git config user.email [email protected]
git log --oneline -1 origin/${{ github.event.pull_request.base.ref }}
git rebase origin/${{ github.event.pull_request.base.ref }}

- name: Determine commits to check
id: get_commits
run: |
COMMITS=$(git rev-list origin/${{ github.event.pull_request.base.ref }}..HEAD | tac)
# rev-list provides one hash per line, starting at HEAD, adding backwards.
# Why `tac` - commits are listed from HEAD backwards, which is reversed order, and need
# re-applying in the correct order.
echo -e "Commits found:\n$COMMITS"
COMMITS_ONELINE=$(echo $COMMITS | tr '\n' ' ')
# GH actions truncates plain multiline variables to first line when passing as output/input,
# so make it one line on our end and save the trouble.
echo "commits=$COMMITS_ONELINE" >> $GITHUB_OUTPUT

- name: Check all commits
run: |
git checkout -b temp origin/${{ github.event.pull_request.base.ref }}
for COMMIT in ${{ steps.get_commits.outputs.commits }} ; do
echo "Checking $COMMIT"
git cherry-pick "$COMMIT"
make -f Makefile.am reload-infra
CHANGES=$(git status -s)
if [[ -n $CHANGES ]] ; then
echo "Templates out of sync after commit $COMMIT:"
git log -1 "$COMMIT"
git status
exit 1
fi
done

infra-template-master-match-check:
runs-on: ubuntu-20.04
name: Compare templates files with master branch
if: github.event.pull_request.base.ref != 'master'

steps:
- name: Clone Anaconda repository
uses: actions/checkout@v3
with:
# TODO: Are we able to remove ref, fetch-depth and Rebase task? Seems that the checkout
# without ref is doing the rebase for us.
# otherwise we are testing target branch instead of the PR branch (see pull_request_target trigger)
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0

- name: Rebase to current
run: |
git config user.name github-actions
git config user.email [email protected]
git log --oneline -1 origin/${{ github.event.pull_request.base.ref }}
git rebase origin/${{ github.event.pull_request.base.ref }}

- name: Check if all changed template files are matching master branch
run: |
changed_template_files_in_pr=$(git diff --diff-filter=M --name-only origin/${{ github.event.pull_request.base.ref }} *.yml.j2)
if [ -z "$changed_template_files_in_pr" ]; then
echo "----- No template files changed -----"

exit 0
fi

changed_files=$(git diff --diff-filter=M --name-only origin/master *.yml.j2)

if [ -n "$changed_files" ]; then
# print for debugging
echo "----- Template files differ with mater branch -----"
echo "$changed_files"
echo "-------------------------"

exit 1
fi
7 changes: 0 additions & 7 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,3 @@ jobs:

- name: Run RPM tests in container
run: make -f Makefile.am container-rpm-test

- name: Upload test logs
if: always()
uses: actions/upload-artifact@v4
with:
name: 'logs-rpm-test (${{ matrix.ci_tag }})'
path: test-logs/*
7 changes: 0 additions & 7 deletions .github/workflows/tests.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,3 @@ jobs:

- name: Run RPM tests in container
run: make -f Makefile.am container-rpm-test

- name: Upload test logs
if: always()
uses: actions/upload-artifact@v4
with:
name: 'logs-rpm-test (${{ matrix.ci_tag }})'
path: test-logs/*
1 change: 0 additions & 1 deletion .packit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ actions:

jobs:


- job: propose_downstream
trigger: release
packages: [anaconda-centos]
Expand Down
2 changes: 0 additions & 2 deletions .packit.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ actions:
- 'bash -c "ls -1 anaconda-*.tar.bz2"'

jobs:

{% if distro_release == "rawhide" %}

- job: propose_downstream
trigger: release
packages: [anaconda-fedora]
Expand Down
Loading