cli_build #720
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test Tag | |
on: | |
repository_dispatch: | |
types: [cli_build] | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: "tag: Tag of the move2kube image to use for testing" | |
required: false | |
default: "latest" | |
commit_ref: | |
description: "commit ref: Reference to a commit or branch or tag name" | |
required: false | |
default: "main" | |
jobs: | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
steps: | |
- id: tag | |
uses: haya14busa/action-cond@v1 | |
with: | |
cond: ${{ github.event.action == 'cli_build' }} | |
if_true: ${{ github.event.client_payload.tag }} | |
if_false: ${{ github.event.inputs.tag }} | |
- id: ref | |
uses: haya14busa/action-cond@v1 | |
with: | |
cond: ${{ github.event.action == 'cli_build' }} | |
if_true: ${{ github.event.client_payload.commit_ref }} | |
if_false: ${{ github.event.inputs.commit_ref }} | |
- uses: actions/checkout@v2 | |
with: | |
ref: ${{ steps.ref.outputs.value }} | |
submodules: true | |
- name: pull existing image for reuse as cache | |
run: docker pull quay.io/konveyor/move2kube-tests:latest || true | |
- name: test | |
run: VERSION='${{ steps.tag.outputs.value }}' make test-docker | |
- run: echo "${{ secrets.QUAY_BOT_PASSWORD }}" | docker login --username "${{ secrets.QUAY_BOT_USERNAME }}" --password-stdin quay.io | |
- name: push image to cache | |
run: docker push quay.io/konveyor/move2kube-tests:${{ steps.tag.outputs.value }} | |
- uses: rtCamp/action-slack-notify@v2 | |
if: failure() | |
env: | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
SLACK_COLOR: "#BD3232" | |
SLACK_ICON: https://github.com/actions.png?size=48 | |
SLACK_MESSAGE: "Test failed for move2kube-tests on branch ${{ steps.ref.outputs.value }}" | |
SLACK_TITLE: Failed | |
SLACK_USERNAME: GitHubActions | |
- name: Success Slack Notification | |
uses: rtCamp/action-slack-notify@v2 | |
env: | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
SLACK_ICON: https://github.com/actions.png?size=48 | |
SLACK_MESSAGE: "Test success for move2kube-tests on branch ${{ steps.ref.outputs.value }}" | |
SLACK_TITLE: Success | |
SLACK_USERNAME: GitHubActions |