Skip to content

Add Pipeline def for snc builder #16

Add Pipeline def for snc builder

Add Pipeline def for snc builder #16

name: snc-runner-builder
on:
push:
tags: [ 'snc-runner-v*' ]
paths:
- '.github\/workflows\/snc-runner\/release-info'
pull_request:
branches: [ main ]
paths: ['snc-runner/**', '.github\/workflows\/snc-runner*' ]
jobs:
build:
name: build
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build image for PR
if: ${{ github.event_name == 'pull_request' }}
env:
SNC_RUNNER: ghcr.io/crc-org/ci-snc-runner
SNC_RUNNER_V: pr-${{ github.event.number }}
run: |
make snc-runner-oci-build
make snc-runner-oci-save
echo "image=${SNC_RUNNER}:${SNC_RUNNER_V}" >> "$GITHUB_ENV"
- name: Build image for Release
if: ${{ github.event_name == 'push' }}
run: |
make snc-runner-oci-build
make snc-runner-oci-save
# Get values from release-info
echo "image=$(sed -n 1p snc-runner/release-info):v$(sed -n 2p snc-runner/release-info)" >> "$GITHUB_ENV"
- name: Create image metadata
run: |
echo ${{ env.image }} > snc-runner-image
echo ${{ github.event_name }} > snc-runner-build-event
- name: Upload snc-runner
uses: actions/upload-artifact@v4
with:
name: snc-runner
path: snc-runner*
tkn-check:
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Template tkn for PR
if: ${{ github.event_name == 'pull_request' }}
env:
CRC_BUILDER: ghcr.io/crc-org/ci-crc-builder
CRC_BUILDER_V: pr-${{ github.event.number }}
run: |
make snc-runner-tkn-create
- name: Check tkn specs
run: |
if [[ ! -f snc-runner/tkn/task.yaml ]]; then
exit 1
fi
if [[ ! -f snc-runner/tkn/pipeline.yaml ]]; then
exit 1
fi
# Check if version is in sync
- name: Create k8s Kind Cluster
uses: helm/kind-action@v1
# https://docs.openshift.com/pipelines/1.15/about/op-release-notes.html
- name: Deploy min supported tekton version
run: kubectl apply -f https://storage.googleapis.com/tekton-releases/pipeline/previous/v0.44.5/release.yaml
- name: Deploy tasks
run: |
kubectl apply -f snc-runner/tkn/task.yaml
kubectl apply -f snc-runner/tkn/pipeline.yaml
- name: Upload crc-builder-tkn
uses: actions/upload-artifact@v4
with:
name: snc-runner-tkn
path: snc-runner/tkn/*.yaml