Kiwi for Codemagic
Report check results from Codemagic to a run's Verify step with a checker key.
- Posts named check results over HTTP with a checker key. The key can report only the checks you choose in one project.
- Checks reserved for CI accept results only from a checker key.
- Records each result against the candidate under review. A pass counts toward Verify; a fail means the run needs rework.
- Records a retried report once.
- Kiwi does not start pipelines or read their logs. It records the results your pipeline sends.
Set up
Store your checker key as a secret environment variable named KIWI_CHECKER_KEY in a variable group named kiwi and add report-kiwi-check.sh from the setup guide to your repository.
This codemagic.yaml runs your tests, then reports the tests-pass check as pass or fail:
workflows:
kiwi:
instance_type: linux_x2
inputs:
kiwiRunId:
description: Kiwi run ID
environment:
groups:
- kiwi
vars:
KIWI_RUN_ID: ${{ inputs.kiwiRunId }}
scripts:
- name: Test
script: npm ci && npm test && touch ~/SUCCESS
publishing:
scripts:
- name: Report to Kiwi
script: |
sudo apt-get update && sudo apt-get install -y uuid-runtime
if [ -f ~/SUCCESS ]; then status=pass; else status=fail; fi
./report-kiwi-check.sh tests-pass "$status" "https://codemagic.io/app/$CM_PROJECT_ID/build/$CM_BUILD_ID"Start the kiwi workflow with the Kiwi run ID as its kiwiRunId input. The report is a publishing script, so it runs even when the tests fail.
linux_x2 machines need billing enabled.
Replace tests-pass with the check ID from your plan.