chore(deps): update actions/checkout digest to a5ac7e5 #132
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
--- | |
name: build-s2i-python-kopf-pr | |
on: | |
pull_request: | |
paths: | |
- build-s2i-python-kopf/** | |
- .github/workflows/build-s2i-python-kopf-pr.yaml | |
# Declare default permissions as read only. | |
permissions: read-all | |
jobs: | |
test: | |
env: | |
CONTEXT_DIR: build-s2i-python-kopf | |
IMAGE_NAME: python-kopf-s2i | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4 | |
- name: Check and verify version.json | |
id: check_version | |
uses: redhat-cop/github-actions/get-image-version@11f2ce27643eb7c76ac3623cb99d9b08be30d762 # v4 | |
with: | |
IMAGE_CONTEXT_DIR: ${{ env.CONTEXT_DIR }} | |
- name: Update Dockerfile version | |
run: | | |
sed -i -e "s/^FROM .*/FROM ${IMAGE_NAME}:${{ steps.check_version.outputs.VERSION }}/" ${CONTEXT_DIR}/examples/kopf-simple/Dockerfile | |
- name: Build s2i image | |
uses: redhat-actions/buildah-build@7a95fa7ee0f02d552a32753e7414641a04307056 # v2 | |
with: | |
context: ${{ env.CONTEXT_DIR }} | |
dockerfiles: | | |
./${{ env.CONTEXT_DIR }}/Dockerfile | |
image: ${{ env.IMAGE_NAME }} | |
oci: true | |
tags: ${{ steps.check_version.outputs.VERSION }} | |
- name: Build kopf-simple example from s2i image | |
uses: redhat-actions/buildah-build@7a95fa7ee0f02d552a32753e7414641a04307056 # v2 | |
with: | |
context: ${{ env.CONTEXT_DIR }}/examples/kopf-simple | |
dockerfiles: | | |
./${{ env.CONTEXT_DIR }}/examples/kopf-simple | |
image: ${{ env.IMAGE_NAME }}-example | |
oci: true | |
tags: ${{ steps.check_version.outputs.VERSION }} | |
- name: Test image | |
run: | | |
EXAMPLE_IMAGE="${IMAGE_NAME}-example:${{ steps.check_version.outputs.VERSION }}" | |
echo "Checking kopf version..." | |
KOPF_VERSION="$(podman run --entrypoint '/bin/sh' $EXAMPLE_IMAGE -c 'kopf --version')" | |
if [[ "$KOPF_VERSION" != 'kopf, version ${{ steps.check_version.outputs.MINOR_VERSION }}' ]]; then | |
echo "$KOPF_VERSION not expected ${{ steps.check_version.outputs.MINOR_VERSION }}" | |
fi | |
echo "Checking example operator.py..." | |
podman run --entrypoint '/bin/sh' $EXAMPLE_IMAGE -c 'python3 -m py_compile /opt/app-root/operator/operator.py' | |
echo "Check example requirements were installed..." | |
podman run --entrypoint '/bin/sh' $EXAMPLE_IMAGE -c 'python3 -c "import yaml"' |