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

The deploy.sh script is not taking UI images #1055

Closed
wants to merge 5 commits into from
Closed
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
105 changes: 102 additions & 3 deletions .github/workflows/test-on-comment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,63 @@ name: Kruize Remote monitoring functional tests
on:
issue_comment:
types: [created]
issue_type: [pull_request]
pull_request_review:
types: [submitted]

jobs:
functest:

# Only run this if the user asked us to
if: github.event.comment.body == 'run functional tests'
if: contains(github.event.comment.body, 'run functional tests')

runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Get workflow run info
run: |
echo "url=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" >> $GITHUB_OUTPUT
echo "id=$GITHUB_RUN_ID" >> $GITHUB_OUTPUT
echo "url=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"
echo "id=$GITHUB_RUN_ID"
id: workflow_run_info

- name: Debug Comment Content
run: echo "Comment :${{ github.event.comment.body }}"


- uses: actions/github-script@v6
id: get-pr
with:
script: |
const request = {
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number
}
core.info(`Getting PR #${request.pull_number} from ${request.owner}/${request.repo}`)
try {
const result = await github.rest.pulls.get(request)
return result.data
} catch (err) {
core.setFailed(`Request failed with error ${err}`)
}

- name: Check out code
uses: actions/checkout@v4
with:
ref: refs/pull/${{ github.event.issue.number }}/head

- name: Setup Minikube
uses: manusa/[email protected]
with:
minikube version: 'v1.16.0'
kubernetes version: 'v1.19.2'

- name: Build crc
run: |
echo Build crc
./build.sh -i autotune_operator:test_build
docker images | grep autotune

- name: Install Prometheus on minikube
run: |
echo Install Prometheus on minikube
Expand Down Expand Up @@ -60,3 +95,67 @@ jobs:
name: kruize_test_results
path: ./kruize_test_results.tar
retention-days: 2

reportFailure:
runs-on: ubuntu-latest
needs: [functest]
if: failure()
steps:
- name: Create comment
uses: actions/github-script@v6
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
comment_body = `
@${{ github.actor }} Build(s) failed.
Workflow Run ID: [${{ needs.functest.outputs.workflow_id }}](${{ needs.functest.outputs.workflow_url }})
`;
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: comment_body
})

reportCancelled:
runs-on: ubuntu-latest
needs: [functest]
if: cancelled()
steps:
- name: Create comment
uses: actions/github-script@v6
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
comment_body = `
@${{ github.actor }} Build(s) cancelled.
Workflow Run ID: [${{ needs.functest.outputs.workflow_id }}](${{ needs.functest.outputs.workflow_url }})
`;
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: comment_body
})

reportSuccess:
runs-on: ubuntu-latest
needs: [functest]
if: success()
steps:
- name: Create comment
uses: actions/github-script@v6
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |

comment_body = `
@${{ github.actor }} Build(s) successful.
Workflow Run ID: [${{ needs.functest.outputs.workflow_id }}](${{ needs.functest.outputs.workflow_url }})
`;
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: comment_body
})
2 changes: 1 addition & 1 deletion deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ function check_cluster_type() {
}

# Iterate through the commandline options
while getopts ac:d:i:k:m:n:o:p:stub-: gopts; do
while getopts ac:d:i:k:m:n:o:p:u:stb-: gopts; do
case ${gopts} in
-)
case "${OPTARG}" in
Expand Down
Loading