diff --git a/.github/workflows/container-autoupdate-fedora.yml.j2 b/.github/workflows/container-autoupdate-fedora.yml.j2 deleted file mode 100644 index eb3a48c2b72..00000000000 --- a/.github/workflows/container-autoupdate-fedora.yml.j2 +++ /dev/null @@ -1,31 +0,0 @@ -{% if distro_release == "rawhide" %} -name: Refresh Fedora container images -on: - schedule: - - cron: 0 0 * * * - # be able to start this action manually from a actions tab when needed - workflow_dispatch: - -permissions: - contents: read - -jobs: - - master: - # Don't run scheduled workflows on forks. - if: github.event_name != 'schedule' || github.repository == 'rhinstaller/anaconda' - uses: ./.github/workflows/container-rebuild-action.yml - secrets: inherit - with: - container-tag: master - branch: master - - {% for branch in supported_branches if branch.variant == "fedora" %} - {$ branch|first $}: - uses: ./.github/workflows/container-rebuild-action.yml - secrets: inherit - with: - container-tag: {$ branch|first $} - branch: {$ branch|first $} - {% endfor %} -{% endif %} diff --git a/.github/workflows/container-autoupdate-fedora.yml b/.github/workflows/container-autoupdate.yml similarity index 64% rename from .github/workflows/container-autoupdate-fedora.yml rename to .github/workflows/container-autoupdate.yml index 22a87677f29..fb0d76f1131 100644 --- a/.github/workflows/container-autoupdate-fedora.yml +++ b/.github/workflows/container-autoupdate.yml @@ -3,9 +3,9 @@ # THIS FILE IS GENERATED FROM A TEMPLATE # DO NOT EDIT THIS FILE MANUALLY! # ====================================== -# The template is located in: container-autoupdate-fedora.yml.j2 +# The template is located in: container-autoupdate.yml.j2 -name: Refresh Fedora container images +name: Refresh Fedora and CentOS Stream container images on: schedule: - cron: 0 0 * * * @@ -16,13 +16,15 @@ permissions: contents: read jobs: - - master: + update-container: + strategy: + fail-fast: false + matrix: + branch: ['master', 'rhel-9', 'rhel-10'] # Don't run scheduled workflows on forks. if: github.event_name != 'schedule' || github.repository == 'rhinstaller/anaconda' uses: ./.github/workflows/container-rebuild-action.yml secrets: inherit with: - container-tag: master - branch: master - + container-tag: ${{ matrix.branch }} + branch: ${{ matrix.branch }} diff --git a/.github/workflows/container-autoupdate.yml.j2 b/.github/workflows/container-autoupdate.yml.j2 new file mode 100644 index 00000000000..b75d86a966c --- /dev/null +++ b/.github/workflows/container-autoupdate.yml.j2 @@ -0,0 +1,23 @@ +name: Refresh Fedora and CentOS Stream container images +on: + schedule: + - cron: 0 0 * * * + # be able to start this action manually from a actions tab when needed + workflow_dispatch: + +permissions: + contents: read + +jobs: + update-container: + strategy: + fail-fast: false + matrix: + branch: ['master'{% for branch in supported_branches %}, '{$ branch|first $}'{% endfor %}] + # Don't run scheduled workflows on forks. + if: github.event_name != 'schedule' || github.repository == 'rhinstaller/anaconda' + uses: ./.github/workflows/container-rebuild-action.yml + secrets: inherit + with: + container-tag: ${{ matrix.branch }} + branch: ${{ matrix.branch }} diff --git a/.github/workflows/container-rebuild-action.yml.j2 b/.github/workflows/container-rebuild-action.yml.j2 deleted file mode 100644 index b1e4c3db503..00000000000 --- a/.github/workflows/container-rebuild-action.yml.j2 +++ /dev/null @@ -1,100 +0,0 @@ -{% if distro_release == "rawhide" %} -name: Rebuild container images -# Rebuilds both ci and rpm container images for a given "target". Currently known targets: -# - master -# - eln -# - fedora-NN -# -# Image is: -# - built from the repo at ref , -# - based on the right container according to branch settings, or optionally on if set, -# - tagged as quay.io/rhinstaller/anaconda-{ci|rpm}:. -# -# See also inputs below. - -# Reusable workflow, does not run on its own. Typically, use in an action this way: -# jobs: -# foo: -# uses: ./.github/workflows/container-rebuild-action.yml -# secrets: inherit -# with: -# container-tag: foo -# branch: foo - -on: - workflow_call: - inputs: - container-tag: - required: true - type: string - branch: - required: true - type: string - base-container: - required: false - type: string - # secrets consumed: QUAY_USERNAME, QUAY_PASSWORD - # these are provided by using the quay.io environment below - -permissions: - contents: read - -jobs: - refresh-container: - name: Refresh anaconda container - runs-on: ubuntu-20.04 - environment: quay.io - strategy: - fail-fast: false - matrix: - container-type: ['ci', 'rpm'] - env: - CI_TAG: '${{ inputs.container-tag }}' - timeout-minutes: 60 - steps: - - name: Checkout anaconda repository - uses: actions/checkout@v4 - with: - ref: ${{ inputs.branch }} - - - name: Build anaconda-${{ matrix.container-type }} container - run: | - BASE_CONTAINER=${{ inputs.base-container }} - make -f Makefile.am anaconda-${{ matrix.container-type }}-build ${BASE_CONTAINER:+BASE_CONTAINER=}${BASE_CONTAINER:-} - - - name: Run tests in anaconda-ci container - if: matrix.container-type == 'ci' - run: | - # put the log in the output, where it's easy to read and link to - make -f Makefile.am container-ci || { cat test-logs/test-suite.log; exit 1; } - - - name: Run tests in anaconda-rpm container - if: matrix.container-type == 'rpm' - run: | - # put the log in the output, where it's easy to read and link to - make -f Makefile.am container-rpm-test || { cat test-logs/test-suite.log; exit 1; } - - - name: Upload test and coverage logs from local testing - if: always() - uses: actions/upload-artifact@v4 - with: - name: ${{ inputs.container-tag }}-${{ matrix.container-type }}-logs - path: | - test-logs/test-suite.log - test-logs/unit_tests.log - test-logs/pylint/runpylint*.log - test-logs/coverage-*.log - - - name: Login to container registry - run: podman login -u ${{ secrets.QUAY_USERNAME }} -p ${{ secrets.QUAY_PASSWORD }} quay.io - - # we can hardcode the path to the image here because this will be executed only for master image - - name: Add latest tag for master container - if: ${{ inputs.container-tag == 'master' }} - run: | - podman tag quay.io/rhinstaller/anaconda-${{ matrix.container-type }}:master quay.io/rhinstaller/anaconda-${{ matrix.container-type }}:latest - CI_TAG=latest make -f Makefile.am anaconda-${{ matrix.container-type }}-push - - - name: Push container to registry - run: make -f Makefile.am anaconda-${{ matrix.container-type }}-push -{% endif %}