mirror of
https://github.com/JasonN3/build-container-installer.git
synced 2025-12-25 10:57:55 +01:00
split tests
This commit is contained in:
parent
3638e94bc8
commit
3f08dd52b2
2 changed files with 211 additions and 0 deletions
108
.github/workflows/test_deployment_rhel.yml
vendored
Normal file
108
.github/workflows/test_deployment_rhel.yml
vendored
Normal file
|
|
@ -0,0 +1,108 @@
|
||||||
|
name: Test Deployment
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
pr:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
parent_job_name:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
suffix:
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
load_vars:
|
||||||
|
name: Load Variables
|
||||||
|
uses: ./.github/workflows/build_vars_rhel.yml
|
||||||
|
|
||||||
|
test-deployment:
|
||||||
|
name: Test deployment
|
||||||
|
env:
|
||||||
|
JOB_NAME: Test deployment
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs:
|
||||||
|
- load_vars
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
statuses: write
|
||||||
|
continue-on-error: false
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
version: ${{ fromJson(needs.load_vars.outputs.BUILD_VERSIONS) }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
|
- name: Switch branch
|
||||||
|
if: inputs.pr
|
||||||
|
env:
|
||||||
|
GITHUB_USER: ${{ github.actor }}
|
||||||
|
GITHUB_TOKEN: ${{ github.token }}
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y hub
|
||||||
|
hub pr checkout ${{ inputs.pr }}
|
||||||
|
echo "sha=$(git rev-parse HEAD)" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Get Current Job Log URL
|
||||||
|
if: inputs.pr && always()
|
||||||
|
uses: Tiryoh/gha-jobid-action@v1
|
||||||
|
id: jobs
|
||||||
|
with:
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
job_name: "${{ inputs.parent_job_name }} / ${{ env.JOB_NAME }} (${{ matrix.version }})"
|
||||||
|
|
||||||
|
- name: Set status
|
||||||
|
if: inputs.pr && always()
|
||||||
|
uses: myrotvorets/set-commit-status-action@v2.0.1
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
status: pending
|
||||||
|
context: ${{ env.JOB_NAME }} (${{ matrix.version }})
|
||||||
|
sha: ${{ env.sha }}
|
||||||
|
targetUrl: ${{ steps.jobs.outputs.html_url }}
|
||||||
|
|
||||||
|
- name: Install test tools
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y unzip make
|
||||||
|
sudo make test/vm/install-deps PACKAGE_MANAGER=apt-get
|
||||||
|
|
||||||
|
- name: Download generated ISO
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: ${{ format('{0}-{1}', needs.load_vars.outputs.IMAGE_NAME, matrix.version) }}${{ inputs.suffix && format('-{0}', inputs.suffix || '') }}
|
||||||
|
|
||||||
|
- name: Run VM Tests
|
||||||
|
env:
|
||||||
|
VM_USER: core
|
||||||
|
VM_PASS: foobar
|
||||||
|
VM_IP: "127.0.0.1"
|
||||||
|
VM_PORT: "5555"
|
||||||
|
run: |
|
||||||
|
make test/vm ISO_NAME=${{ format('{0}-{1}', needs.load_vars.outputs.IMAGE_NAME, matrix.version) }}${{ inputs.suffix && format('-{0}', inputs.suffix || '') }}.iso \
|
||||||
|
VM_IP=${VM_IP} VM_PORT=${VM_PORT} VM_USER=${VM_USER} VM_PASS=${VM_PASS} \
|
||||||
|
ARCH=${{ needs.load_vars.outputs.ARCH}} \
|
||||||
|
IMAGE_NAME=${{ needs.load_vars.outputs.IMAGE_NAME}} \
|
||||||
|
IMAGE_REPO=${{ needs.load_vars.outputs.IMAGE_REPO}} \
|
||||||
|
IMAGE_TAG=${{ matrix.version }} \
|
||||||
|
VERSION=${{ matrix.version }} \
|
||||||
|
VARIANT=${{ needs.load_vars.outputs.VARIANT }} \
|
||||||
|
SECURE_BOOT_KEY_URL=${{ needs.load_vars.outputs.SECURE_BOOT_KEY_URL }} \
|
||||||
|
ENROLLMENT_PASSWORD=${{ needs.load_vars.outputs.ENROLLMENT_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Set status
|
||||||
|
if: inputs.pr && always()
|
||||||
|
uses: myrotvorets/set-commit-status-action@v2.0.1
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
status: ${{ job.status }}
|
||||||
|
context: ${{ env.JOB_NAME }} (${{ matrix.version }})
|
||||||
|
sha: ${{ env.sha }}
|
||||||
|
targetUrl: ${{ steps.jobs.outputs.html_url }}
|
||||||
103
.github/workflows/test_iso_rhel.yml
vendored
Normal file
103
.github/workflows/test_iso_rhel.yml
vendored
Normal file
|
|
@ -0,0 +1,103 @@
|
||||||
|
name: Test ISO
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
pr:
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
parent_job_name:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
suffix:
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
load_vars:
|
||||||
|
name: Load Variables
|
||||||
|
uses: ./.github/workflows/build_vars_rhel.yml
|
||||||
|
|
||||||
|
test-iso:
|
||||||
|
name: Test ISO
|
||||||
|
env:
|
||||||
|
JOB_NAME: Test ISO
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs:
|
||||||
|
- load_vars
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
statuses: write
|
||||||
|
continue-on-error: false
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
version: ${{ fromJson(needs.load_vars.outputs.BUILD_VERSIONS) }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
|
- name: Switch branch
|
||||||
|
if: inputs.pr
|
||||||
|
env:
|
||||||
|
GITHUB_USER: ${{ github.actor }}
|
||||||
|
GITHUB_TOKEN: ${{ github.token }}
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y hub
|
||||||
|
hub pr checkout ${{ inputs.pr }}
|
||||||
|
echo "sha=$(git rev-parse HEAD)" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Get Current Job Log URL
|
||||||
|
if: inputs.pr && always()
|
||||||
|
uses: Tiryoh/gha-jobid-action@v1
|
||||||
|
id: jobs
|
||||||
|
with:
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
job_name: "${{ inputs.parent_job_name }} / ${{ env.JOB_NAME }} (${{ matrix.version }})"
|
||||||
|
|
||||||
|
- name: Set status
|
||||||
|
if: inputs.pr && always()
|
||||||
|
uses: myrotvorets/set-commit-status-action@v2.0.1
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
status: pending
|
||||||
|
context: ${{ env.JOB_NAME }} (${{ matrix.version }})
|
||||||
|
sha: ${{ env.sha }}
|
||||||
|
targetUrl: ${{ steps.jobs.outputs.html_url }}
|
||||||
|
|
||||||
|
- name: Install test tools
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y make
|
||||||
|
sudo make test/iso/install-deps PACKAGE_MANAGER=apt-get
|
||||||
|
|
||||||
|
- name: Download generated ISO
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: ${{ format('{0}-{1}', needs.load_vars.outputs.IMAGE_NAME, matrix.version) }}${{ inputs.suffix && format('-{0}', inputs.suffix || '') }}
|
||||||
|
|
||||||
|
- name: Run ISO checks
|
||||||
|
run: |
|
||||||
|
make test/iso \
|
||||||
|
ARCH=${{ needs.load_vars.outputs.ARCH}} \
|
||||||
|
IMAGE_NAME=${{ needs.load_vars.outputs.IMAGE_NAME}} \
|
||||||
|
IMAGE_REPO=${{ needs.load_vars.outputs.IMAGE_REPO}} \
|
||||||
|
IMAGE_TAG=${{ matrix.version }} \
|
||||||
|
VERSION=${{ matrix.version }} \
|
||||||
|
VARIANT=${{ needs.load_vars.outputs.VARIANT }} \
|
||||||
|
SECURE_BOOT_KEY_URL=${{ needs.load_vars.outputs.SECURE_BOOT_KEY_URL }} \
|
||||||
|
ENROLLMENT_PASSWORD=${{ needs.load_vars.outputs.ENROLLMENT_PASSWORD }} \
|
||||||
|
ISO_NAME=${{ format('{0}-{1}', needs.load_vars.outputs.IMAGE_NAME, matrix.version) }}${{ inputs.suffix && format('-{0}', inputs.suffix || '') }}.iso
|
||||||
|
|
||||||
|
- name: Set status
|
||||||
|
if: inputs.pr && always()
|
||||||
|
uses: myrotvorets/set-commit-status-action@v2.0.1
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
status: ${{ job.status }}
|
||||||
|
context: ${{ env.JOB_NAME }} (${{ matrix.version }})
|
||||||
|
sha: ${{ env.sha }}
|
||||||
|
targetUrl: ${{ steps.jobs.outputs.html_url }}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue