Skip to content

Image refresh for rhel-9-0 #6957

Image refresh for rhel-9-0

Image refresh for rhel-9-0 #6957

Workflow file for this run

name: test
on: [pull_request]
jobs:
bots:
runs-on: ubuntu-22.04
container:
image: ghcr.io/cockpit-project/unit-tests
options: --user root
permissions:
pull-requests: none
steps:
- name: Clone repository
uses: actions/checkout@v3
# https://github.blog/2022-04-12-git-security-vulnerability-announced/
- name: Pacify git's permission check
run: git config --global --add safe.directory /__w/bots/bots
- name: Run test
run: test/run
cockpituous:
runs-on: ubuntu-22.04
permissions:
# enough permissions for tests-scan to work
pull-requests: read
statuses: write
steps:
- name: Clone repository
uses: actions/checkout@v3
with:
# need this to get origin/main for git diff
fetch-depth: 0
- name: Rebase to target branch
run: |
git config user.name github-actions
git config user.email [email protected]
git rebase origin/${{ github.event.pull_request.base.ref }}
- name: Check whether there are changes that might affect the deployment
id: changes
run: |
git log --exit-code --stat HEAD --not origin/${{ github.event.pull_request.base.ref }} -- \
':!images' \
':!image-create' \
':!image-customize' \
':!image-trigger' \
':!naughty' \
':!machine/machine_core' \
':!lib/testmap.py' \
':!vm-run' \
>&2 || echo "::set-output name=changed::true"
- name: Ensure branch was proposed from origin
if: steps.changes.outputs.changed
run: test "${{ github.event.pull_request.head.repo.url }}" = "${{ github.event.pull_request.base.repo.url }}"
- name: Clone cockpituous repository
if: steps.changes.outputs.changed
uses: actions/checkout@v3
with:
repository: cockpit-project/cockpituous
path: cockpituous
- name: Test local CI deployment
if: steps.changes.outputs.changed
run: |
set -ex
if [ -n '${{ github.event.pull_request.number }}' ]; then
echo '${{ secrets.GITHUB_TOKEN }}' > /tmp/github-token
pr_args='-r ${{ github.event.pull_request.base.user.login }}/bots -p ${{ github.event.pull_request.number }} -t /tmp/github-token'
repo='${{ github.event.pull_request.head.repo.clone_url }}'
branch='${{ github.event.pull_request.head.ref }}'
else
# push event; skip testing a PR
repo='${{ github.event.repository.clone_url }}'
branch="${GITHUB_REF##*/}"
fi
cd cockpituous
COCKPIT_BOTS_REPO=$repo COCKPIT_BOTS_BRANCH=$branch tasks/run-local.sh ${pr_args:-}