mirror of
https://github.com/JasonN3/build-container-installer.git
synced 2025-12-25 10:57:55 +01:00
separate tests
This commit is contained in:
parent
67c9098ddc
commit
a483dc92a4
5 changed files with 227 additions and 32 deletions
25
.github/workflows/build_iso.yml
vendored
25
.github/workflows/build_iso.yml
vendored
|
|
@ -18,16 +18,11 @@ on:
|
||||||
suffix:
|
suffix:
|
||||||
required: false
|
required: false
|
||||||
type: string
|
type: string
|
||||||
secrets:
|
|
||||||
RH_REPO:
|
|
||||||
required: true
|
|
||||||
RH_ENT:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
load_vars:
|
load_vars:
|
||||||
name: Load Variables
|
name: Load Variables
|
||||||
uses: ./.github/workflows/build_vars.yml
|
uses: ./.github/workflows/build_vars_rhel.yml
|
||||||
|
|
||||||
build_iso:
|
build_iso:
|
||||||
name: Build ISO
|
name: Build ISO
|
||||||
|
|
@ -45,10 +40,6 @@ jobs:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
version: ${{ fromJson(needs.load_vars.outputs.BUILD_VERSIONS) }}
|
version: ${{ fromJson(needs.load_vars.outputs.BUILD_VERSIONS) }}
|
||||||
include:
|
|
||||||
- version: 8
|
|
||||||
image_tag: 39
|
|
||||||
rhel: true
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
@ -118,15 +109,6 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
|
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
|
||||||
|
|
||||||
- name: Get UBI Subs
|
|
||||||
if: matrix.rhel == true
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
repository: ${{ secrets.RH_REPO }}
|
|
||||||
ssh-key: ${{ secrets.RH_ENT }}
|
|
||||||
persist-credentials: false
|
|
||||||
path: ubi
|
|
||||||
|
|
||||||
- name: Build ISO
|
- name: Build ISO
|
||||||
uses: ./
|
uses: ./
|
||||||
id: build
|
id: build
|
||||||
|
|
@ -134,7 +116,7 @@ jobs:
|
||||||
arch: ${{ needs.load_vars.outputs.ARCH }}
|
arch: ${{ needs.load_vars.outputs.ARCH }}
|
||||||
image_name: ${{ needs.load_vars.outputs.IMAGE_NAME }}
|
image_name: ${{ needs.load_vars.outputs.IMAGE_NAME }}
|
||||||
image_repo: ${{ needs.load_vars.outputs.IMAGE_REPO }}
|
image_repo: ${{ needs.load_vars.outputs.IMAGE_REPO }}
|
||||||
image_tag: ${{ matrix.image_tag || matrix.version }}
|
image_tag: ${{ matrix.version }}
|
||||||
version: ${{ matrix.version }}
|
version: ${{ matrix.version }}
|
||||||
variant: ${{ needs.load_vars.outputs.VARIANT }}
|
variant: ${{ needs.load_vars.outputs.VARIANT }}
|
||||||
flatpak_remote_refs: ${{ inputs.flatpaks_refs }}
|
flatpak_remote_refs: ${{ inputs.flatpaks_refs }}
|
||||||
|
|
@ -142,8 +124,7 @@ jobs:
|
||||||
secure_boot_key_url: ${{ needs.load_vars.outputs.SECURE_BOOT_KEY_URL }}
|
secure_boot_key_url: ${{ needs.load_vars.outputs.SECURE_BOOT_KEY_URL }}
|
||||||
enrollment_password: ${{ needs.load_vars.outputs.ENROLLMENT_PASSWORD }}
|
enrollment_password: ${{ needs.load_vars.outputs.ENROLLMENT_PASSWORD }}
|
||||||
iso_name: build/${{ needs.load_vars.outputs.IMAGE_NAME }}-${{ matrix.version }}${{ inputs.suffix && format('-{0}', inputs.suffix || '') }}.iso
|
iso_name: build/${{ needs.load_vars.outputs.IMAGE_NAME }}-${{ matrix.version }}${{ inputs.suffix && format('-{0}', inputs.suffix || '') }}.iso
|
||||||
secrets_dir: ${{ matrix.rhel && format('{0}/ubi', github.workspace) || '' }}
|
repos: '/etc/yum.repos.d/fedora.repo /etc/yum.repos.d/fedora-updates.repo'
|
||||||
repos: ${{ matrix.rhel && '/etc/yum.repos.d/redhat.repo' || '/etc/yum.repos.d/fedora.repo /etc/yum.repos.d/fedora-updates.repo' }}
|
|
||||||
|
|
||||||
- name: Upload ISO as artifact
|
- name: Upload ISO as artifact
|
||||||
id: upload
|
id: upload
|
||||||
|
|
|
||||||
157
.github/workflows/build_iso_rhel.yml
vendored
Normal file
157
.github/workflows/build_iso_rhel.yml
vendored
Normal file
|
|
@ -0,0 +1,157 @@
|
||||||
|
name: Build ISO
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
pr:
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
parent_job_name:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
suffix:
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
secrets:
|
||||||
|
RH_REPO:
|
||||||
|
required: true
|
||||||
|
RH_ENT:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
load_vars:
|
||||||
|
name: Load Variables
|
||||||
|
uses: ./.github/workflows/build_vars.yml
|
||||||
|
|
||||||
|
build_iso:
|
||||||
|
name: Build ISO
|
||||||
|
env:
|
||||||
|
JOB_NAME: Build ISO
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs:
|
||||||
|
- load_vars
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
packages: write
|
||||||
|
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: Free Disk Space (Ubuntu)
|
||||||
|
uses: jlumbroso/free-disk-space@main
|
||||||
|
with:
|
||||||
|
# this might remove tools that are actually needed,
|
||||||
|
# if set to "true" but frees about 6 GB
|
||||||
|
tool-cache: false
|
||||||
|
|
||||||
|
# all of these default to true, but feel free to set to
|
||||||
|
# "false" if necessary for your workflow
|
||||||
|
android: true
|
||||||
|
dotnet: true
|
||||||
|
haskell: true
|
||||||
|
large-packages: true
|
||||||
|
docker-images: true
|
||||||
|
swap-storage: true
|
||||||
|
|
||||||
|
- name: Lowercase Registry
|
||||||
|
id: registry_case
|
||||||
|
uses: ASzc/change-string-case-action@v6
|
||||||
|
with:
|
||||||
|
string: ${{ needs.load_vars.outputs.IMAGE_REPO }}
|
||||||
|
|
||||||
|
- name: Get image version
|
||||||
|
id: meta
|
||||||
|
uses: docker/metadata-action@v5
|
||||||
|
with:
|
||||||
|
tags: |
|
||||||
|
type=ref,event=branch
|
||||||
|
type=ref,event=pr
|
||||||
|
|
||||||
|
- name: Login to Registry
|
||||||
|
run: |
|
||||||
|
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
|
||||||
|
|
||||||
|
- name: Get UBI Subs
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
repository: ${{ secrets.RH_REPO }}
|
||||||
|
ssh-key: ${{ secrets.RH_ENT }}
|
||||||
|
persist-credentials: false
|
||||||
|
path: ubi
|
||||||
|
|
||||||
|
- name: Build ISO
|
||||||
|
uses: ./
|
||||||
|
id: build
|
||||||
|
with:
|
||||||
|
arch: ${{ needs.load_vars.outputs.ARCH }}
|
||||||
|
image_name: ${{ needs.load_vars.outputs.IMAGE_NAME }}
|
||||||
|
image_repo: ${{ needs.load_vars.outputs.IMAGE_REPO }}
|
||||||
|
image_tag: ${{ needs.load_vars.outputs.IMAGE_TAG }}
|
||||||
|
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: build/${{ needs.load_vars.outputs.IMAGE_NAME }}-${{ matrix.version }}${{ inputs.suffix && format('-{0}', inputs.suffix || '') }}.iso
|
||||||
|
secrets_dir: ${{ format('{0}/ubi', github.workspace) }}
|
||||||
|
repos: '/etc/yum.repos.d/redhat.repo'
|
||||||
|
|
||||||
|
- name: Upload ISO as artifact
|
||||||
|
id: upload
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: ${{ needs.load_vars.outputs.IMAGE_NAME }}-${{ matrix.version }}${{ inputs.suffix && format('-{0}', inputs.suffix || '') }}
|
||||||
|
path: |
|
||||||
|
build/${{ needs.load_vars.outputs.IMAGE_NAME }}-${{ matrix.version }}${{ inputs.suffix && format('-{0}', inputs.suffix || '') }}.iso
|
||||||
|
build/${{ needs.load_vars.outputs.IMAGE_NAME }}-${{ matrix.version }}${{ inputs.suffix && format('-{0}', inputs.suffix || '') }}.iso-CHECKSUM
|
||||||
|
if-no-files-found: error
|
||||||
|
retention-days: 0
|
||||||
|
compression-level: 0
|
||||||
|
overwrite: true
|
||||||
|
|
||||||
|
- 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 }}
|
||||||
|
|
||||||
2
.github/workflows/build_vars.yml
vendored
2
.github/workflows/build_vars.yml
vendored
|
|
@ -7,6 +7,8 @@ on:
|
||||||
value: 'x86_64'
|
value: 'x86_64'
|
||||||
BUILD_VERSIONS:
|
BUILD_VERSIONS:
|
||||||
value: '[38, 39, 40]'
|
value: '[38, 39, 40]'
|
||||||
|
BUILD_VERSIONS_RHEL:
|
||||||
|
value: '[8]'
|
||||||
IMAGE_NAME:
|
IMAGE_NAME:
|
||||||
value: 'base'
|
value: 'base'
|
||||||
IMAGE_REPO:
|
IMAGE_REPO:
|
||||||
|
|
|
||||||
31
.github/workflows/build_vars_rhel.yml
vendored
Normal file
31
.github/workflows/build_vars_rhel.yml
vendored
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
name: Build Vars
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
outputs:
|
||||||
|
ARCH:
|
||||||
|
value: 'x86_64'
|
||||||
|
BUILD_VERSIONS:
|
||||||
|
value: '[8]'
|
||||||
|
IMAGE_NAME:
|
||||||
|
value: 'fedora-bootc'
|
||||||
|
IMAGE_REPO:
|
||||||
|
value: 'quay.io/centos-bootc'
|
||||||
|
IMAGE_TAG:
|
||||||
|
value: 'eln'
|
||||||
|
VARIANT:
|
||||||
|
value: 'Server'
|
||||||
|
SECURE_BOOT_KEY_URL:
|
||||||
|
value: 'https://github.com/ublue-os/akmods/raw/main/certs/public_key.der'
|
||||||
|
ENROLLMENT_PASSWORD:
|
||||||
|
value: 'container-installer'
|
||||||
|
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
load-vars:
|
||||||
|
name: Load Variables
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Sucess
|
||||||
|
run:
|
||||||
|
echo "Vars loaded"
|
||||||
42
.github/workflows/tests.yml
vendored
42
.github/workflows/tests.yml
vendored
|
|
@ -49,9 +49,6 @@ jobs:
|
||||||
parent_job_name: ${{ inputs.parent_job_name && format('{0} / ', inputs.parent_job_name) }}Build ISO with Flatpaks
|
parent_job_name: ${{ inputs.parent_job_name && format('{0} / ', inputs.parent_job_name) }}Build ISO with Flatpaks
|
||||||
flatpaks_refs_dir: flatpak_refs
|
flatpaks_refs_dir: flatpak_refs
|
||||||
suffix: flatpaks
|
suffix: flatpaks
|
||||||
secrets:
|
|
||||||
RH_REPO: ${{ secrets.RH_REPO }}
|
|
||||||
RH_ENT: ${{ secrets.RH_ENT }}
|
|
||||||
|
|
||||||
test_iso_flatpaks:
|
test_iso_flatpaks:
|
||||||
name: Test ISO with Flatpaks
|
name: Test ISO with Flatpaks
|
||||||
|
|
@ -85,9 +82,6 @@ jobs:
|
||||||
parent_job_name: ${{ inputs.parent_job_name && format('{0} / ', inputs.parent_job_name) }}Build ISO with Flatpak Refs
|
parent_job_name: ${{ inputs.parent_job_name && format('{0} / ', inputs.parent_job_name) }}Build ISO with Flatpak Refs
|
||||||
flatpaks_refs: "app/org.mozilla.firefox/x86_64/stable app/org.videolan.VLC/x86_64/stable"
|
flatpaks_refs: "app/org.mozilla.firefox/x86_64/stable app/org.videolan.VLC/x86_64/stable"
|
||||||
suffix: flatpaks_refs
|
suffix: flatpaks_refs
|
||||||
secrets:
|
|
||||||
RH_REPO: ${{ secrets.RH_REPO }}
|
|
||||||
RH_ENT: ${{ secrets.RH_ENT }}
|
|
||||||
|
|
||||||
test_iso_flatpak_refs:
|
test_iso_flatpak_refs:
|
||||||
name: Test ISO with Flatpak Refs
|
name: Test ISO with Flatpak Refs
|
||||||
|
|
@ -119,9 +113,6 @@ jobs:
|
||||||
with:
|
with:
|
||||||
pr: ${{ inputs.pr }}
|
pr: ${{ inputs.pr }}
|
||||||
parent_job_name: ${{ inputs.parent_job_name && format('{0} / ', inputs.parent_job_name) }}Build ISO
|
parent_job_name: ${{ inputs.parent_job_name && format('{0} / ', inputs.parent_job_name) }}Build ISO
|
||||||
secrets:
|
|
||||||
RH_REPO: ${{ secrets.RH_REPO }}
|
|
||||||
RH_ENT: ${{ secrets.RH_ENT }}
|
|
||||||
|
|
||||||
test_iso:
|
test_iso:
|
||||||
name: Test ISO
|
name: Test ISO
|
||||||
|
|
@ -140,3 +131,36 @@ jobs:
|
||||||
with:
|
with:
|
||||||
pr: ${{ inputs.pr }}
|
pr: ${{ inputs.pr }}
|
||||||
parent_job_name: ${{ inputs.parent_job_name && format('{0} / ', inputs.parent_job_name) }}Test Deployment
|
parent_job_name: ${{ inputs.parent_job_name && format('{0} / ', inputs.parent_job_name) }}Test Deployment
|
||||||
|
|
||||||
|
build_iso_rhel:
|
||||||
|
name: Build RHEL ISO
|
||||||
|
needs:
|
||||||
|
- build_container
|
||||||
|
uses: ./.github/workflows/build_iso_rhel.yml
|
||||||
|
with:
|
||||||
|
pr: ${{ inputs.pr }}
|
||||||
|
parent_job_name: ${{ inputs.parent_job_name && format('{0} / ', inputs.parent_job_name) }}Build ISO
|
||||||
|
suffix: rhel
|
||||||
|
secrets:
|
||||||
|
RH_REPO: ${{ secrets.RH_REPO }}
|
||||||
|
RH_ENT: ${{ secrets.RH_ENT }}
|
||||||
|
|
||||||
|
test_iso_rhel:
|
||||||
|
name: Test RHEL ISO
|
||||||
|
needs:
|
||||||
|
- build_iso
|
||||||
|
uses: ./.github/workflows/test_iso.yml
|
||||||
|
with:
|
||||||
|
pr: ${{ inputs.pr }}
|
||||||
|
parent_job_name: ${{ inputs.parent_job_name && format('{0} / ', inputs.parent_job_name) }}Test ISO
|
||||||
|
suffix: rhel
|
||||||
|
|
||||||
|
test_deployment_rhel:
|
||||||
|
name: Test RHEL Deployment
|
||||||
|
needs:
|
||||||
|
- build_iso
|
||||||
|
uses: ./.github/workflows/test_deployment.yml
|
||||||
|
with:
|
||||||
|
pr: ${{ inputs.pr }}
|
||||||
|
parent_job_name: ${{ inputs.parent_job_name && format('{0} / ', inputs.parent_job_name) }}Test Deployment
|
||||||
|
suffix: rhel
|
||||||
Loading…
Add table
Add a link
Reference in a new issue