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

feat(ci): test7 #1642

Closed
wants to merge 14 commits into from
2 changes: 1 addition & 1 deletion .github/workflows/image-cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ jobs:
ignore-missing-package: true
tag-regex: pr-${{ github.event.number }}-.*
tagged-keep-latest: 0
if: github.repository_owner == 'cryostatio'
#if: github.repository_owner == 'cryostatio'
4 changes: 3 additions & 1 deletion .github/workflows/pr-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ on:
jobs:
check-before-build:
runs-on: ubuntu-latest
if: github.repository_owner == 'cryostatio' && github.event.issue.pull_request && startsWith(github.event.comment.body, '/build_test')
#if: github.repository_owner == 'cryostatio' && github.event.issue.pull_request && startsWith(github.event.comment.body, '/build_test')
if: github.event.issue.pull_request && startsWith(github.event.comment.body, '/build_test')

steps:
- name: Fail if needs-triage label applied
if: ${{ contains(github.event.issue.labels.*.name, 'needs-triage') }}
Expand Down
56 changes: 56 additions & 0 deletions .github/workflows/pr-request-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Request Review

on:
issue_comment:
types:
- created

jobs:
request-review:
runs-on: ubuntu-latest
permissions:
pull-requests: write

if: github.event.issue.pull_request && startsWith(github.event.comment.body, '/request_review')

steps:
- name: Set up GitHub CLI
uses: actions/setup-gh@v2
with:
gh-version: 2 # You can adjust this version if needed

- name: Checkout code
uses: actions/checkout@v2

- name: Set up Git
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "actions@github.com"

- name: Add label and request review
run: |
reviewers="@cryostatio/reviewers"
pr_number=${{ github.event.issue.number }}

echo "Adding label 'review-requested' to the PR"
gh pr edit $pr_number --add-label "review-requested"

if [ -n "$reviewers" ]; then
gh pr request-review $pr_number --reviewer $reviewers
else
echo "Requesting review from @cryostatio/reviewer(s) team"
gh pr request-review $pr_number --team cryostatio/reviewer(s)
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Remove label on review
run: |
pr_number=${{ github.event.issue.number }}
reviews_status=$(gh pr list --json state,reviews -q ".[] | select(.number == $pr_number) | .reviews[].state")
if [[ -n "$reviews_status" ]]; then
echo "Changes requested, removing 'review-requested' label"
gh pr edit $pr_number --remove-label "review-requested"
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22 changes: 11 additions & 11 deletions .github/workflows/push-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,49 +18,49 @@ jobs:
checkout-repo: ${{ github.event.pull_request.head.repo.full_name }}
checkout-ref: ${{ github.event.pull_request.head.ref }}
secrets: inherit
if: github.repository_owner == 'cryostatio'
#if: github.repository_owner == 'cryostatio'
build-and-test-amd64:
uses: ./.github/workflows/ci-build-image.yml
secrets: inherit
with:
build-arch: amd64
if: github.repository_owner == 'cryostatio'
#if: github.repository_owner == 'cryostatio'
build-and-test-arm64:
uses: ./.github/workflows/ci-build-image.yml
secrets: inherit
with:
build-arch: arm64
skip-itests: true
if: github.repository_owner == 'cryostatio'
#if: github.repository_owner == 'cryostatio'
push-to-quay:
runs-on: ubuntu-latest
needs: [code-analysis, build-and-test-amd64, build-and-test-arm64]
env:
CRYOSTAT_IMG: quay.io/cryostat/cryostat
if: always() && github.repository_owner == 'cryostatio'
#if: always() && github.repository_owner == 'cryostatio'
steps:
- uses: actions/download-artifact@v3
with:
name: cryostat-amd64
if: github.repository_owner == 'cryostatio'
#if: github.repository_owner == 'cryostatio'
- name: Load cryostat-amd64 image
env:
IMAGE_VERSION: ${{ needs.build-and-test-amd64.outputs.image-version }}
run: |
podman load -i cryostat-amd64.tar
podman tag quay.io/cryostat/cryostat:latest $CRYOSTAT_IMG:$IMAGE_VERSION-linux-amd64
if: github.repository_owner == 'cryostatio'
#if: github.repository_owner == 'cryostatio'
- uses: actions/download-artifact@v3
with:
name: cryostat-arm64
if: github.repository_owner == 'cryostatio'
#if: github.repository_owner == 'cryostatio'
- name: Load cryostat-arm64 image
env:
IMAGE_VERSION: ${{ needs.build-and-test-arm64.outputs.image-version }}
run: |
podman load -i cryostat-arm64.tar
podman tag quay.io/cryostat/cryostat:latest $CRYOSTAT_IMG:$IMAGE_VERSION-linux-arm64
if: github.repository_owner == 'cryostatio'
#if: github.repository_owner == 'cryostatio'
- name: Create OCI Manifest
id: create-manifest
env:
Expand All @@ -75,7 +75,7 @@ jobs:
else
echo "::set-output name=tags::$IMAGE_VERSION"
fi
if: github.repository_owner == 'cryostatio'
#if: github.repository_owner == 'cryostatio'
- name: Push to quay.io
uses: redhat-actions/push-to-registry@v2
with:
Expand All @@ -84,7 +84,7 @@ jobs:
registry: quay.io/cryostat
username: cryostat+bot
password: ${{ secrets.REGISTRY_PASSWORD }}
if: github.repository_owner == 'cryostatio'
#if: github.repository_owner == 'cryostatio'
- name: Print image URL
run: echo "Image pushed to ${{ steps.push-to-quay.outputs.registry-paths }}"
if: github.repository_owner == 'cryostatio'
#if: github.repository_owner == 'cryostatio'
1 change: 1 addition & 0 deletions .github/workflows/semantic-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ jobs:
- uses: amannn/action-semantic-pull-request@v3.4.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
#
Loading