.github/workflows/jenkins-dispatch.yml #1919
Workflow file for this run
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
on: | |
workflow_dispatch: | |
inputs: | |
server_image: | |
description: "server image: repo/name:tag" | |
required: true | |
type: string | |
client_image: | |
description: "client image: repo/name:tag" | |
required: true | |
type: string | |
sha: | |
description: "commit sha to report status" | |
required: false | |
type: string | |
jobs: | |
helm-tests: | |
runs-on: ubuntu-latest | |
env: | |
WORK_DIR: sources/pmm-qa/src/github.com/percona/pmm-qa/pmm-tests | |
GH_API_TOKEN: ${{ secrets.GH_API_TOKEN }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
submodules: "recursive" | |
- name: run ci.py | |
run: | | |
pip3 install PyGithub | |
pip3 install GitPython | |
python3 ci.py | |
- name: install tools | |
run: | | |
npm install -g bats | |
$WORK_DIR/install_k8s_tools.sh --minikube --helm --kubectl --user | |
- name: Start minikube | |
run: | | |
minikube start | |
kubectl wait --for=condition=Ready node --timeout=90s minikube | |
- name: Run helm tests | |
run: | | |
echo $(git submodule status) | |
cd $WORK_DIR | |
export IMAGE_REPO=$(echo $SERVER_IMAGE | cut -d ':' -f 1) | |
export IMAGE_TAG=$(echo $SERVER_IMAGE | cut -d ':' -f 2) | |
bats --tap pmm-2-0-bats-tests/helm-test.bats | |
env: | |
SERVER_IMAGE: ${{ inputs.server_image }} | |
- name: Create status check | |
if: ${{ always() }} | |
continue-on-error: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
REPO: ${{ github.repository }} | |
RUN_ID: ${{ github.run_id }} | |
SHA: ${{ inputs.sha }} | |
STATUS: ${{ job.status }} | |
run: | | |
if [ "${STATUS}" = "cancelled" ]; then | |
STATUS="error" | |
fi | |
gh api \ | |
--method POST \ | |
-H "Accept: application/vnd.github.v3+json" \ | |
/repos/$REPO/statuses/$SHA \ | |
-f state="$STATUS" \ | |
-f target_url="https://github.com/$REPO/actions/runs/$RUN_ID" \ | |
-f description="Helm Tests status: $STATUS" \ | |
-f context='actions/workflows/helm-tests' |