From 7c6a5b6342162dafed9279b3ad7510c5d51df5b2 Mon Sep 17 00:00:00 2001 From: Pablo Acevedo Montserrat Date: Thu, 16 Oct 2025 14:17:33 +0200 Subject: [PATCH 1/8] Add linters workflows --- .github/workflows/linters.yaml | 55 ++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflows/linters.yaml diff --git a/.github/workflows/linters.yaml b/.github/workflows/linters.yaml new file mode 100644 index 00000000..34c50dc0 --- /dev/null +++ b/.github/workflows/linters.yaml @@ -0,0 +1,55 @@ +name: linters +description: Presubmit static checks and linting + +on: + pull_request: + +jobs: + check-changes: + runs-on: ubuntu-latest + outputs: + shell: ${{ steps.changed-files-sh.outputs.any_changed }} + docker: ${{ steps.changed-files-docker.outputs.any_changed }} + steps: + - name: Check out code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Get changed shell files + id: changed-files-sh + uses: tj-actions/changed-files@v44 + with: + files: | + **/*.sh + + - name: Get changed container files + id: changed-files-docker + uses: tj-actions/changed-files@v44 + with: + files: | + **/*Containerfile* + + shellcheck: + needs: check-changes + if: needs.check-changes.outputs.shell == 'true' + runs-on: ubuntu-latest + steps: + - name: Check out MicroShift upstream repository + uses: actions/checkout@v4 + + - name: Run ShellCheck + run: | + make _shellcheck + + hadolint: + needs: check-changes + if: needs.check-changes.outputs.docker == 'true' + runs-on: ubuntu-latest + steps: + - name: Check out MicroShift upstream repository + uses: actions/checkout@v4 + + - name: Run Hadolint + run: | + make _hadolint From 9993f71d751bd5125e849c285ae9d859e8ec7104 Mon Sep 17 00:00:00 2001 From: Pablo Acevedo Montserrat Date: Thu, 16 Oct 2025 14:34:22 +0200 Subject: [PATCH 2/8] Add builders workflows --- .github/workflows/builders.yaml | 101 ++++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 .github/workflows/builders.yaml diff --git a/.github/workflows/builders.yaml b/.github/workflows/builders.yaml new file mode 100644 index 00000000..243de278 --- /dev/null +++ b/.github/workflows/builders.yaml @@ -0,0 +1,101 @@ +name: builders +description: Presubmit build and deploy from sources tests + +on: + pull_request: + +jobs: + centos9-bootc: + runs-on: ubuntu-latest + steps: + - name: Check out MicroShift upstream repository + uses: actions/checkout@v4 + + - name: Detect OKD version tag + id: detect-okd-version + uses: ./.github/actions/okd-version + + - name: Run the build action + uses: ./.github/actions/build + with: + ushift-branch: main + okd-version-tag: ${{ steps.detect-okd-version.outputs.okd-version-tag }} + bootc-image-url: quay.io/centos-bootc/centos-bootc + bootc-image-tag: stream9 + build: bootc-image + + centos10-bootc: + runs-on: ubuntu-latest + steps: + - name: Check out MicroShift upstream repository + uses: actions/checkout@v4 + + - name: Detect OKD version tag + id: detect-okd-version + uses: ./.github/actions/okd-version + + - name: Run the build action + uses: ./.github/actions/build + with: + ushift-branch: main + okd-version-tag: ${{ steps.detect-okd-version.outputs.okd-version-tag }} + bootc-image-url: quay.io/centos-bootc/centos-bootc + bootc-image-tag: stream10 + build: bootc-image + + fedora-bootc: + runs-on: ubuntu-latest + steps: + - name: Check out MicroShift upstream repository + uses: actions/checkout@v4 + + - name: Detect OKD version tag + id: detect-okd-version + uses: ./.github/actions/okd-version + + - name: Run the build action + uses: ./.github/actions/build + with: + ushift-branch: main + okd-version-tag: ${{ steps.detect-okd-version.outputs.okd-version-tag }} + bootc-image-url: registry.fedoraproject.org/fedora-bootc + bootc-image-tag: latest + build: bootc-image + + isolated-network-kindnet: + runs-on: ubuntu-latest + steps: + - name: Check out MicroShift upstream repository + uses: actions/checkout@v4 + + - name: Detect OKD version tag + id: detect-okd-version + uses: ./.github/actions/okd-version + + - name: Run the build action + uses: ./.github/actions/build + with: + ushift-branch: main + okd-version-tag: ${{ steps.detect-okd-version.outputs.okd-version-tag }} + isolated-network: 1 + ovnk-networking: 0 + build: bootc-image + + isolated-network-ovnk: + runs-on: ubuntu-latest + steps: + - name: Check out MicroShift upstream repository + uses: actions/checkout@v4 + + - name: Detect OKD version tag + id: detect-okd-version + uses: ./.github/actions/okd-version + + - name: Run the build action + uses: ./.github/actions/build + with: + ushift-branch: main + okd-version-tag: ${{ steps.detect-okd-version.outputs.okd-version-tag }} + isolated-network: 1 + ovnk-networking: 1 + build: bootc-image From 9b6cfde43ce5bd777a88add90a690957fe17bebe Mon Sep 17 00:00:00 2001 From: Pablo Acevedo Montserrat Date: Thu, 16 Oct 2025 14:42:49 +0200 Subject: [PATCH 3/8] Add installers workflows --- .github/workflows/installers.yaml | 39 +++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/installers.yaml diff --git a/.github/workflows/installers.yaml b/.github/workflows/installers.yaml new file mode 100644 index 00000000..fa49f27c --- /dev/null +++ b/.github/workflows/installers.yaml @@ -0,0 +1,39 @@ +name: installers +description: Presubmit prebuilt packages tests. + +on: + pull_request: + +jobs: + quick-start-and-clean: + runs-on: ubuntu-latest + steps: + - name: Check out MicroShift upstream repository + uses: actions/checkout@v4 + + - name: Run the quick start script + shell: bash + run: | + set -x + cat ./src/quickstart.sh | sudo bash -x + + # Wait until the MicroShift service is ready and healthy + make run-ready + make run-healthy + + - name: Run the quick clean script + shell: bash + run: | + set -x + cat ./src/quickclean.sh | sudo bash -x + + # Verify the container and its image are removed + sudo podman ps -a | grep microshift-okd && exit 1 + sudo podman images | grep microshift-okd && exit 1 + + # Verify the LVM volume group and backing storage are removed + sudo vgs | grep myvg1 && exit 1 + if [ -e /var/lib/microshift-okd ]; then + ls -la /var/lib/microshift-okd/ + exit 1 + fi From 05e7957cd28ee1eb00829f31558791ff87280325 Mon Sep 17 00:00:00 2001 From: Pablo Acevedo Montserrat Date: Thu, 16 Oct 2025 14:45:25 +0200 Subject: [PATCH 4/8] Remove old presubmit workflows definitions --- .github/workflows/presubmit.yaml | 155 ------------------------------- 1 file changed, 155 deletions(-) delete mode 100644 .github/workflows/presubmit.yaml diff --git a/.github/workflows/presubmit.yaml b/.github/workflows/presubmit.yaml deleted file mode 100644 index 4504124b..00000000 --- a/.github/workflows/presubmit.yaml +++ /dev/null @@ -1,155 +0,0 @@ -name: presubmit-pr-check -description: Presubmit Pull Request Verification - -on: - pull_request: - branches: [ main ] - -jobs: - shellcheck: - runs-on: ubuntu-latest - steps: - - name: Check out MicroShift upstream repository - uses: actions/checkout@v4 - - - name: Run ShellCheck - run: | - make _shellcheck - - hadolint: - runs-on: ubuntu-latest - steps: - - name: Check out MicroShift upstream repository - uses: actions/checkout@v4 - - - name: Run Hadolint - run: | - make _hadolint - - centos9-bootc-test: - runs-on: ubuntu-latest - steps: - - name: Check out MicroShift upstream repository - uses: actions/checkout@v4 - - - name: Detect OKD version tag - id: detect-okd-version - uses: ./.github/actions/okd-version - - - name: Run the build action - uses: ./.github/actions/build - with: - ushift-branch: main - okd-version-tag: ${{ steps.detect-okd-version.outputs.okd-version-tag }} - bootc-image-url: quay.io/centos-bootc/centos-bootc - bootc-image-tag: stream9 - build: bootc-image - - centos10-bootc-test: - runs-on: ubuntu-latest - steps: - - name: Check out MicroShift upstream repository - uses: actions/checkout@v4 - - - name: Detect OKD version tag - id: detect-okd-version - uses: ./.github/actions/okd-version - - - name: Run the build action - uses: ./.github/actions/build - with: - ushift-branch: main - okd-version-tag: ${{ steps.detect-okd-version.outputs.okd-version-tag }} - bootc-image-url: quay.io/centos-bootc/centos-bootc - bootc-image-tag: stream10 - build: bootc-image - - fedora-bootc-test: - runs-on: ubuntu-latest - steps: - - name: Check out MicroShift upstream repository - uses: actions/checkout@v4 - - - name: Detect OKD version tag - id: detect-okd-version - uses: ./.github/actions/okd-version - - - name: Run the build action - uses: ./.github/actions/build - with: - ushift-branch: main - okd-version-tag: ${{ steps.detect-okd-version.outputs.okd-version-tag }} - bootc-image-url: registry.fedoraproject.org/fedora-bootc - bootc-image-tag: latest - build: bootc-image - - isolated-network-kindnet-test: - runs-on: ubuntu-latest - steps: - - name: Check out MicroShift upstream repository - uses: actions/checkout@v4 - - - name: Detect OKD version tag - id: detect-okd-version - uses: ./.github/actions/okd-version - - - name: Run the build action - uses: ./.github/actions/build - with: - ushift-branch: main - okd-version-tag: ${{ steps.detect-okd-version.outputs.okd-version-tag }} - isolated-network: 1 - ovnk-networking: 0 - build: bootc-image - - isolated-network-ovnk-test: - runs-on: ubuntu-latest - steps: - - name: Check out MicroShift upstream repository - uses: actions/checkout@v4 - - - name: Detect OKD version tag - id: detect-okd-version - uses: ./.github/actions/okd-version - - - name: Run the build action - uses: ./.github/actions/build - with: - ushift-branch: main - okd-version-tag: ${{ steps.detect-okd-version.outputs.okd-version-tag }} - isolated-network: 1 - ovnk-networking: 1 - build: bootc-image - - quick-start-and-clean: - runs-on: ubuntu-latest - steps: - - name: Check out MicroShift upstream repository - uses: actions/checkout@v4 - - - name: Run the quick start script - shell: bash - run: | - set -x - cat ./src/quickstart.sh | sudo bash -x - - # Wait until the MicroShift service is ready and healthy - make run-ready - make run-healthy - - - name: Run the quick clean script - shell: bash - run: | - set -x - cat ./src/quickclean.sh | sudo bash -x - - # Verify the container and its image are removed - sudo podman ps -a | grep microshift-okd && exit 1 - sudo podman images | grep microshift-okd && exit 1 - - # Verify the LVM volume group and backing storage are removed - sudo vgs | grep myvg1 && exit 1 - if [ -e /var/lib/microshift-okd ]; then - ls -la /var/lib/microshift-okd/ - exit 1 - fi From f758ce9f1f3c855be57742f611473161f7cb6158 Mon Sep 17 00:00:00 2001 From: Pablo Acevedo Montserrat Date: Thu, 16 Oct 2025 17:30:32 +0200 Subject: [PATCH 5/8] Remove check-changes step from linters --- .github/workflows/linters.yaml | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/.github/workflows/linters.yaml b/.github/workflows/linters.yaml index 34c50dc0..67b649a8 100644 --- a/.github/workflows/linters.yaml +++ b/.github/workflows/linters.yaml @@ -5,34 +5,7 @@ on: pull_request: jobs: - check-changes: - runs-on: ubuntu-latest - outputs: - shell: ${{ steps.changed-files-sh.outputs.any_changed }} - docker: ${{ steps.changed-files-docker.outputs.any_changed }} - steps: - - name: Check out code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Get changed shell files - id: changed-files-sh - uses: tj-actions/changed-files@v44 - with: - files: | - **/*.sh - - - name: Get changed container files - id: changed-files-docker - uses: tj-actions/changed-files@v44 - with: - files: | - **/*Containerfile* - shellcheck: - needs: check-changes - if: needs.check-changes.outputs.shell == 'true' runs-on: ubuntu-latest steps: - name: Check out MicroShift upstream repository @@ -43,8 +16,6 @@ jobs: make _shellcheck hadolint: - needs: check-changes - if: needs.check-changes.outputs.docker == 'true' runs-on: ubuntu-latest steps: - name: Check out MicroShift upstream repository From 3ade74214d83f88bbcbfdbb0e61771ec3b81b865 Mon Sep 17 00:00:00 2001 From: Pablo Acevedo Montserrat Date: Thu, 16 Oct 2025 18:08:07 +0200 Subject: [PATCH 6/8] Remove postimage kube setup from quickstart --- src/quickstart.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/quickstart.sh b/src/quickstart.sh index 808bd141..f566bcaf 100755 --- a/src/quickstart.sh +++ b/src/quickstart.sh @@ -68,10 +68,6 @@ function run_bootc_image() { fi sleep 1 done - - # Update kubeconfig in the container user home directory - podman exec microshift-okd /bin/mkdir -p /root/.kube - podman exec microshift-okd /bin/cp "${kubeconfig}" /root/.kube/config } # Check if the script is running as root From 1154dc6649294928646ee1cd6a231226ea8e8a88 Mon Sep 17 00:00:00 2001 From: Pablo Acevedo Montserrat Date: Thu, 16 Oct 2025 20:18:40 +0200 Subject: [PATCH 7/8] Remove unsupported description field from workflows --- .github/workflows/builders.yaml | 2 +- .github/workflows/installers.yaml | 2 +- .github/workflows/linters.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/builders.yaml b/.github/workflows/builders.yaml index 243de278..4be4e174 100644 --- a/.github/workflows/builders.yaml +++ b/.github/workflows/builders.yaml @@ -1,5 +1,5 @@ name: builders -description: Presubmit build and deploy from sources tests +# Presubmit build and deploy from sources tests on: pull_request: diff --git a/.github/workflows/installers.yaml b/.github/workflows/installers.yaml index fa49f27c..07ef8a3a 100644 --- a/.github/workflows/installers.yaml +++ b/.github/workflows/installers.yaml @@ -1,5 +1,5 @@ name: installers -description: Presubmit prebuilt packages tests. +# Presubmit prebuilt packages tests. on: pull_request: diff --git a/.github/workflows/linters.yaml b/.github/workflows/linters.yaml index 67b649a8..169c3ec0 100644 --- a/.github/workflows/linters.yaml +++ b/.github/workflows/linters.yaml @@ -1,5 +1,5 @@ name: linters -description: Presubmit static checks and linting +# Presubmit static checks and linting on: pull_request: From f4ea8e9272c5eef5b694d03f266e728f832b145f Mon Sep 17 00:00:00 2001 From: Pablo Acevedo Montserrat Date: Thu, 16 Oct 2025 22:11:04 +0200 Subject: [PATCH 8/8] Fix pipefail error in installers workflow --- .github/workflows/installers.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/installers.yaml b/.github/workflows/installers.yaml index 07ef8a3a..6919bfa9 100644 --- a/.github/workflows/installers.yaml +++ b/.github/workflows/installers.yaml @@ -14,8 +14,8 @@ jobs: - name: Run the quick start script shell: bash run: | - set -x - cat ./src/quickstart.sh | sudo bash -x + set -xeuo pipefail + sudo bash -xeuo pipefail < ./src/quickstart.sh # Wait until the MicroShift service is ready and healthy make run-ready @@ -24,8 +24,8 @@ jobs: - name: Run the quick clean script shell: bash run: | - set -x - cat ./src/quickclean.sh | sudo bash -x + set -xeuo pipefail + sudo bash -xeuo pipefail < ./src/quickstart.sh # Verify the container and its image are removed sudo podman ps -a | grep microshift-okd && exit 1