Skip to content

Commit

Permalink
XXX test check_run
Browse files Browse the repository at this point in the history
  • Loading branch information
martinpitt committed Oct 17, 2023
1 parent 240d2b7 commit 05d49ed
Showing 1 changed file with 13 additions and 36 deletions.
49 changes: 13 additions & 36 deletions .github/workflows/trigger-anaconda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,46 +8,23 @@

name: anaconda
on:
pull_request_target:
# only bridge and Storage page affect anaconda
paths:
- src/cockpit/**
- pkg/storaged/**
check_run:
types: [completed]
jobs:
trigger:
runs-on: ubuntu-22.04
# the default workflow token cannot read our org membership, for deciding who is allowed to trigger tests
environment: gh-cockpituous
container: registry.fedoraproject.org/fedora:rawhide
# this polls for a COPR build, which can take long
timeout-minutes: 120
if: ${{ github.event.check_run.name == "rpm-build:fedora-rawhide-x86_64" && github.event.check_run.pull_requests }}
timeout-minutes: 5

steps:
- name: Install dependencies
run: |
dnf install -y git-core dnf-plugins-core || {
sleep 60
dnf install -y git-core dnf-plugins-core
}
- name: Wait for packit COPR build
- name: debug info
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
DIFF_URL: "${{ github.event.repository.html_url }}/pull/${{ github.event.check_run.pull_requests[0].number }}.diff"
run: |
set -ex
COPR_NAME="${{ github.event.pull_request.base.user.login }}-${{ github.event.pull_request.base.repo.name }}-${{ github.event.number }}"
SHA=$(echo "${{ github.event.pull_request.head.sha }}" | cut -c 1-8)
for _ in $(seq 60); do
sleep 60;
if dnf copr enable -y packit/$COPR_NAME &&
out=$(dnf info --refresh --repo='copr:*cockpit*' cockpit-bridge) &&
echo "$out" | grep -q "Release.*\.g$SHA" ; then
exit 0
fi
done
exit 1
- name: Trigger anaconda run
run: |
git clone --depth=1 https://github.com/cockpit-project/bots
mkdir -p ~/.config/cockpit-dev
echo '${{ secrets.COCKPITUOUS_TOKEN }}' > ~/.config/cockpit-dev/github-token
bots/tests-trigger --repo ${{ github.repository }} ${{ github.event.number }} fedora-rawhide-boot/cockpit-pr-${{ github.event.number }}@rhinstaller/anaconda
echo "GITHUB_SHA: $GITHUB_SHA"
echo "GITHUB_REF: $GITHUB_REF"
echo "github: $GITHUB_CONTEXT"
echo "DIFF_URL: $DIFF_URL"
curl -L "$DIFF_URL"

0 comments on commit 05d49ed

Please sign in to comment.