Skip to content

tests: pr-build-extension workflow for PR check #2

tests: pr-build-extension workflow for PR check

tests: pr-build-extension workflow for PR check #2

Workflow file for this run

#
# Copyright (C) 2023 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
name: pr-check
on:
workflow_run:
workflows:
- build-extension
types:
- completed
jobs:
push-extension:
name: Push OCI image to ghcr
runs-on: ubuntu-22.04
if: |
github.event.workflow_run.conclusion == 'success'
steps:
- name: Download extension oci flatten images
uses: actions/download-artifact@v4
with:
name: podman-desktop-image-checker-openshift-ext
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ github.event.workflow_run.id }}
- name: Read image name
id: read-image
run: |
echo "IMAGE=$(cat podman-desktop-image-checker-openshift-ext.image)" >> "$GITHUB_ENV"
- name: Log in to ghcr.io
uses: redhat-actions/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push image for release
shell: bash
run: |
podman load -i podman-desktop-image-checker-openshift-ext.tar
podman push "$IMAGE"
e2e-tests:
name: Run E2E Tests
runs-on: ubuntu-22.04
needs: push-extension
env:
PD_VERSION: 1.19.1
steps:
- name: Checkout the image checker repo
uses: actions/checkout@v4
with:
path: image-checker-extension
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22
- name: Download Podman Desktop pre-release binary
run: |
curl -L -o podman-desktop.tar.gz https://github.com/podman-desktop/podman-desktop/releases/download/v${PD_VERSION}/podman-desktop-${PD_VERSION}.tar.gz
mkdir -p podman-desktop-bin
tar -xzf podman-desktop.tar.gz -C podman-desktop-bin
chmod +x podman-desktop-bin/podman-desktop-${PD_VERSION}
echo "PD_PATH=$(pwd)" >> "$GITHUB_ENV"
pwd
ls -la podman-desktop-bin/podman-desktop-${PD_VERSION}
- name: Install yarn
working-directory: image-checker-extension/podman-desktop-extension
run: yarn install --frozen-lockfile
- name: Setup environment for E2E tests
working-directory: ./image-checker-extension/podman-desktop-extension
env:
PODMAN_DESKTOP_ARGS: ${{ github.workspace }}/podman-desktop-bin/podman-desktop-${{ env.PD_VERSION }}
EXTENSION_PREINSTALLED: true
run: |
if [ -f "${{ github.workspace }}/podman-desktop-bin/podman-desktop-${{ env.PD_VERSION }}/podman-desktop" ]; then
echo "PD binary exists in ENV."
else
echo "PD binary does not exist in ENV."
fi
- name: Run E2E tests
working-directory: ./image-checker-extension/podman-desktop-extension
yarn test:e2e
- name: Publish Test Report
uses: mikepenz/action-junit-report@v5
if: always()
with:
annotate_only: true
fail_on_failure: true
include_passed: true
detailed_summary: true
require_tests: true
report_paths: '**/*results.xml'
- uses: actions/upload-artifact@v4
if: always()
with:
name: pr-check
path: |
./**/tests/**/output/
!./**/*.gguf
!./**/*.bin
!./**/tests/**/videos/*
!./**/tests/**/traces/*
- name: Upload test videos
uses: actions/upload-artifact@v4
if: always()
with:
name: pr-check-videos
path: ./**/tests/playwright/output/videos/*
- name: Upload test traces
uses: actions/upload-artifact@v4
if: always()
with:
name: pr-check-traces
path: ./**/tests/playwright/output/traces/*