diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-03 14:01:37 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-03 14:01:37 +0000 |
commit | 734d725d62d2cbe4445524448de024e3b9e7f4b3 (patch) | |
tree | 88d8385f24a0efda248b3480fe39037b85e76552 /.github/workflows | |
parent | Releasing progress-linux version 060+5-8~progress7.99u1. (diff) | |
download | dracut-734d725d62d2cbe4445524448de024e3b9e7f4b3.tar.xz dracut-734d725d62d2cbe4445524448de024e3b9e7f4b3.zip |
Merging upstream version 102.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '.github/workflows')
-rw-r--r-- | .github/workflows/codeql.yml | 18 | ||||
-rw-r--r-- | .github/workflows/container.yml | 73 | ||||
-rw-r--r-- | .github/workflows/integration.yml | 197 | ||||
-rw-r--r-- | .github/workflows/lint.yml | 38 | ||||
-rw-r--r-- | .github/workflows/manualtest.yml | 50 | ||||
-rw-r--r-- | .github/workflows/pr.yml | 9 | ||||
-rw-r--r-- | .github/workflows/release.yml | 9 |
7 files changed, 314 insertions, 80 deletions
diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index e6f8e42..9839ad0 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -7,10 +7,14 @@ name: "CodeQL" on: push: branches: - - master + - main + paths: + - 'src/**' pull_request: branches: - - master + - main + paths: + - 'src/**' permissions: contents: read @@ -18,7 +22,7 @@ permissions: jobs: analyze: name: Analyze - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest concurrency: group: ${{ github.workflow }}-${{ matrix.language }}-${{ github.ref }} cancel-in-progress: true @@ -33,10 +37,10 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Initialize CodeQL - uses: github/codeql-action/init@v2 + uses: github/codeql-action/init@v3 with: languages: ${{ matrix.language }} queries: +security-extended,security-and-quality @@ -47,7 +51,7 @@ jobs: sudo apt -y install asciidoc gcc libkmod-dev libsystemd-dev pkg-config - name: Autobuild - uses: github/codeql-action/autobuild@v2 + uses: github/codeql-action/autobuild@v3 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + uses: github/codeql-action/analyze@v3 diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml index d8c8808..666f887 100644 --- a/.github/workflows/container.yml +++ b/.github/workflows/container.yml @@ -3,12 +3,12 @@ on: schedule: - cron: '30 11 * * *' # every day at 11:30 UTC push: - branches: [ master ] + branches: [ main ] paths: - 'test/container/**' - '.github/workflows/container.yml' pull_request: - branches: [ master ] + branches: [ main ] paths: - 'test/container/**' - '.github/workflows/container.yml' @@ -18,30 +18,68 @@ permissions: contents: read jobs: - push_to_registry: - if: github.repository == 'dracutdevs/dracut' || vars.CONTAINER == 'enabled' - name: Build and push containers image to GitHub Packages + arm64: + if: github.repository == 'dracut-ng/dracut-ng' || vars.CONTAINER == 'enabled' + name: ${{ matrix.config.tag }} on ${{ matrix.config.platform }} runs-on: ubuntu-latest concurrency: - group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.config.dockerfile }} + group: arm64-${{ github.workflow }}-${{ github.ref }}-${{ matrix.config.dockerfile }} cancel-in-progress: true strategy: fail-fast: false matrix: config: - - { dockerfile: 'Dockerfile-Fedora-latest', tag: 'fedora:latest' } - - { dockerfile: 'Dockerfile-OpenSuse-latest', tag: 'opensuse:latest' } - - { dockerfile: 'Dockerfile-Arch', tag: 'arch:latest' } - - { dockerfile: 'Dockerfile-Debian', tag: 'debian:latest' } - - { dockerfile: 'Dockerfile-Gentoo', tag: 'gentoo:latest' } - - { dockerfile: 'Dockerfile-Ubuntu', tag: 'ubuntu:latest' } + - { dockerfile: 'Dockerfile-Debian', tag: 'debian', platform: 'linux/arm64,linux/amd64' } + - { dockerfile: 'Dockerfile-Fedora-latest', tag: 'fedora', platform: 'linux/arm64,linux/amd64' } + steps: + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: ${{ matrix.config.platform }} + - name: Check out the repo + uses: actions/checkout@v4 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Set up env + run: echo "repository_owner=${GITHUB_REPOSITORY_OWNER,,}" >>${GITHUB_ENV} + - name: Build and Push Container + uses: docker/build-push-action@v5 + with: + file: test/container/${{ matrix.config.dockerfile }} + tags: ghcr.io/${{env.repository_owner}}/${{ matrix.config.tag }}:latest + push: ${{ github.event_name == 'push' || github.event_name == 'schedule' }} + platforms: ${{ matrix.config.platform }} + + amd64: + if: github.repository == 'dracut-ng/dracut-ng' || vars.CONTAINER == 'enabled' + name: ${{ matrix.config.tag }} on ${{ matrix.config.platform }} + runs-on: ubuntu-latest + concurrency: + group: amd64-${{ github.workflow }}-${{ github.ref }}-${{ matrix.config.dockerfile }} + cancel-in-progress: true + strategy: + fail-fast: false + matrix: + config: + - { dockerfile: 'Dockerfile-OpenSuse-latest', tag: 'opensuse', platform: 'linux/amd64' } + - { dockerfile: 'Dockerfile-Arch', tag: 'arch', platform: 'linux/amd64' } + - { dockerfile: 'Dockerfile-Gentoo', tag: 'gentoo', platform: 'linux/amd64' } + - { dockerfile: 'Dockerfile-Ubuntu', tag: 'ubuntu', platform: 'linux/amd64' } + - { dockerfile: 'Dockerfile-alpine', tag: 'alpine', platform: 'linux/amd64' } + - { dockerfile: 'Dockerfile-Void', tag: 'void', platform: 'linux/amd64' } steps: - name: Check out the repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Login to GitHub Container Registry - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.repository_owner }} @@ -49,8 +87,9 @@ jobs: - name: Set up env run: echo "repository_owner=${GITHUB_REPOSITORY_OWNER,,}" >>${GITHUB_ENV} - name: Build and Push Container - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v5 with: file: test/container/${{ matrix.config.dockerfile }} - tags: ghcr.io/${{env.repository_owner}}/${{ matrix.config.tag }} + tags: ghcr.io/${{env.repository_owner}}/${{ matrix.config.tag }}:latest push: ${{ github.event_name == 'push' || github.event_name == 'schedule' }} + platforms: ${{ matrix.config.platform }} diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index ab075b0..6e323b7 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -2,30 +2,147 @@ name: Integration Test on: pull_request: - branches: [ master ] + branches: [ main ] env: DEBUGFAIL: "${{ secrets.ACTIONS_STEP_DEBUG && 'rd.debug' }}" jobs: - test: + basic: + name: ${{ matrix.test }} on ${{ matrix.container }} runs-on: ubuntu-latest timeout-minutes: 30 concurrency: - group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.container }}-${{ matrix.test }} + group: basic-${{ github.workflow }}-${{ github.ref }}-${{ matrix.container }}-${{ matrix.test }} cancel-in-progress: true strategy: matrix: container: [ - "arch:latest", - "debian:latest", - "fedora:latest", - "gentoo:latest", - "opensuse:latest", - "ubuntu:latest", + "alpine", + "arch", + "debian", + "fedora", + "gentoo", + "opensuse", + "ubuntu", + "void", ] test: [ "01", + ] + fail-fast: false + container: + image: ghcr.io/dracut-ng/${{ matrix.container }} + options: "--privileged -v /dev:/dev" + steps: + - name: "Checkout Repository" + uses: actions/checkout@v4 + - name: "${{ matrix.container }} TEST-${{ matrix.test }}" + run: ./tools/test-github.sh "TEST-${{ matrix.test }}" ${{ matrix.test }} + network: + name: ${{ matrix.test }} on ${{ matrix.container }} using ${{ matrix.network }} + runs-on: ubuntu-latest + timeout-minutes: 45 + concurrency: + group: network-${{ github.workflow }}-${{ github.ref }}-${{ matrix.container }}-${{ matrix.test }}-${{ matrix.network }} + cancel-in-progress: true + strategy: + matrix: + container: [ + "fedora", + ] + network: [ + "network", + ] + test: [ + "20", + "40", + "50", + "60", + ] + fail-fast: false + container: + image: ghcr.io/dracut-ng/${{ matrix.container }} + options: "--privileged -v /dev:/dev" + steps: + - name: "Checkout Repository" + uses: actions/checkout@v4 + - name: "${{ matrix.container }} TEST-${{ matrix.test }}" + run: USE_NETWORK=${{ matrix.network }} ./tools/test-github.sh "TEST-${{ matrix.test }}" ${{ matrix.test }} + network-legacy: + name: ${{ matrix.test }} on ${{ matrix.container }} using ${{ matrix.network }} + runs-on: ubuntu-latest + timeout-minutes: 45 + concurrency: + group: network-legacy-${{ github.workflow }}-${{ github.ref }}-${{ matrix.container }}-${{ matrix.test }}-${{ matrix.network }} + cancel-in-progress: true + strategy: + matrix: + container: [ + "opensuse", + ] + network: [ + "network-legacy", + ] + test: [ + "20", + "30", + "40", + ] + fail-fast: false + container: + image: ghcr.io/dracut-ng/${{ matrix.container }} + options: "--privileged -v /dev:/dev" + steps: + - name: "Checkout Repository" + uses: actions/checkout@v4 + - name: "${{ matrix.container }} TEST-${{ matrix.test }}" + run: USE_NETWORK=${{ matrix.network }} ./tools/test-github.sh "TEST-${{ matrix.test }}" ${{ matrix.test }} + systemd-networkd: + name: ${{ matrix.test }} on ${{ matrix.container }} using ${{ matrix.network }} + runs-on: ubuntu-latest + timeout-minutes: 45 + concurrency: + group: systemd-networkd-${{ github.workflow }}-${{ github.ref }}-${{ matrix.container }}-${{ matrix.test }}-${{ matrix.network }} + cancel-in-progress: true + strategy: + matrix: + container: [ + "arch", + ] + network: [ + "systemd-networkd", + ] + test: [ + "35", + "40", + ] + fail-fast: false + container: + image: ghcr.io/dracut-ng/${{ matrix.container }} + options: "--privileged -v /dev:/dev" + steps: + - name: "Checkout Repository" + uses: actions/checkout@v4 + - name: "${{ matrix.container }} TEST-${{ matrix.test }}" + run: USE_NETWORK=${{ matrix.network }} ./tools/test-github.sh "TEST-${{ matrix.test }}" ${{ matrix.test }} + extended: + name: ${{ matrix.test }} on ${{ matrix.container }} + runs-on: ubuntu-latest + timeout-minutes: 30 + concurrency: + group: extended-${{ github.workflow }}-${{ github.ref }}-${{ matrix.container }}-${{ matrix.test }} + cancel-in-progress: true + strategy: + matrix: + container: [ + "arch", + "debian", + "fedora", + "gentoo", + "ubuntu", + ] + test: [ "02", "03", "04", @@ -43,50 +160,60 @@ jobs: ] fail-fast: false container: - image: ghcr.io/dracutdevs/${{ matrix.container }} + image: ghcr.io/dracut-ng/${{ matrix.container }} options: "--privileged -v /dev:/dev" steps: - name: "Checkout Repository" - uses: actions/checkout@v1 - with: - fetch-depth: 0 - + uses: actions/checkout@v4 - name: "${{ matrix.container }} TEST-${{ matrix.test }}" run: ./tools/test-github.sh "TEST-${{ matrix.test }}" ${{ matrix.test }} - network: + dracut-cpio: + name: ${{ matrix.test }} on ${{ matrix.container }} runs-on: ubuntu-latest - timeout-minutes: 45 + timeout-minutes: 30 concurrency: - group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.container }}-${{ matrix.test }}-${{ matrix.network }} + group: dracut-cpio-${{ github.workflow }}-${{ github.ref }}-${{ matrix.container }}-${{ matrix.test }} cancel-in-progress: true strategy: matrix: container: [ - "fedora:latest", - ] - network: [ - "network-manager", - "network-legacy", - #"systemd-networkd", - #"connman", + "opensuse", ] test: [ - "20", - "30", - "35", - "40", - "60", - # "50", # times out + "63", ] fail-fast: false container: - image: ghcr.io/dracutdevs/${{ matrix.container }} + image: ghcr.io/dracut-ng/${{ matrix.container }} options: "--privileged -v /dev:/dev" steps: - name: "Checkout Repository" - uses: actions/checkout@v3 + uses: actions/checkout@v4 + - name: "${{ matrix.container }} TEST-${{ matrix.test }}" + run: ./tools/test-github.sh "TEST-${{ matrix.test }}" ${{ matrix.test }} + arm64: + name: ${{ matrix.test }} on ${{ matrix.container }} on arm64 + runs-on: ubuntu-latest + timeout-minutes: 30 + concurrency: + group: arm64-${{ github.workflow }}-${{ github.ref }}-${{ matrix.container }}-${{ matrix.test }} + cancel-in-progress: true + strategy: + matrix: + container: [ + "debian", + "fedora", + ] + test: [ + "98", + ] + fail-fast: false + steps: + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 with: - fetch-depth: 0 - + platforms: 'linux/arm64' + - name: "Checkout Repository" + uses: actions/checkout@v4 - name: "${{ matrix.container }} TEST-${{ matrix.test }}" - run: USE_NETWORK=${{ matrix.network }} ./tools/test-github.sh "TEST-${{ matrix.test }}" ${{ matrix.test }} + run: docker run --platform linux/arm64 --privileged -v /dev:/dev -v $PWD:/w ghcr.io/dracut-ng/${{ matrix.container }} /w/tools/test-github.sh "TEST-${{ matrix.test }}" ${{ matrix.test }} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index d02b332..16dac6c 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -2,31 +2,53 @@ name: Lint on: push: - branches: [ master ] + branches: [ main ] pull_request: - branches: [ master ] + branches: [ main ] jobs: lint-shell: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: shfmt - uses: luizm/action-sh-checker@v0.6.0 + uses: luizm/action-sh-checker@v0.8.0 env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SHFMT_OPTS: -s # arguments to shfmt. with: - sh_checker_shellcheck_disable: false - sh_checker_comment: true + sh_checker_shellcheck_disable: true # disable shellcheck in favor of differential-shellcheck + + differential-shellcheck: + runs-on: ubuntu-latest + + permissions: + security-events: write + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - id: ShellCheck + name: Differential ShellCheck + uses: redhat-plumbers-in-action/differential-shellcheck@v5 + with: + token: ${{ secrets.GITHUB_TOKEN }} + + - if: ${{ always() }} + name: Upload artifact with ShellCheck defects in SARIF format + uses: actions/upload-artifact@v4 + with: + name: Differential ShellCheck SARIF + path: ${{ steps.ShellCheck.outputs.sarif }} lint-c: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: install tools run: sudo apt-get install astyle diff --git a/.github/workflows/manualtest.yml b/.github/workflows/manualtest.yml index b790dcf..74e5647 100644 --- a/.github/workflows/manualtest.yml +++ b/.github/workflows/manualtest.yml @@ -5,34 +5,70 @@ on: inputs: test: description: "Array of tests to run, such as [11,12]" - default: "['04']" - required: true + default: "[]" container: type: choice description: 'distro' - default: 'fedora' + default: 'all' options: + - "all" + - "alpine" - "fedora" - "arch" - "debian" - "ubuntu" - "opensuse" - "gentoo" + - "void" + env: + description: 'Environment (optional)' + default: '{"DEBUGFAIL": "rd.debug"}' + registry: + description: 'Registry for containers, such as ghcr.io/dracut-ng' + +env: + ${{ fromJSON(inputs.env) }} jobs: + matrix: + runs-on: ubuntu-latest + outputs: + registry: ${{ steps.set-matrix.outputs.registry }} + container: ${{ steps.set-matrix.outputs.container }} + tests: ${{ steps.set-matrix.outputs.tests }} + steps: + - name: "Checkout Repository" + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - id: set-matrix + name: "Set Matrix" + run: | + [[ "${{ inputs.registry }}" != '' ]] && echo "registry=\"${{ inputs.registry }}\"" >> $GITHUB_OUTPUT \ + || ( echo "registry=\"ghcr.io/${{ github.repository_owner }}\"" >> $GITHUB_OUTPUT ) + [[ "${{ inputs.container }}" != 'all' ]] && echo "container=[\"${{ inputs.container }}\"]" >> $GITHUB_OUTPUT \ + || ( containers=$(find test/container -name "Dockerfile-*" | cut -d\- -f2 | tr '[:upper:]' '[:lower:]' | sed -z 's/\n/","/g'); echo "container=[\"${containers%??}]" >> $GITHUB_OUTPUT ) + [[ "${{ toJson(fromJson(inputs.test)) }}" != '[]' ]] && echo "tests=${{ inputs.test }}" >> $GITHUB_OUTPUT \ + || ( tests=$(find test -type d -a -name "TEST-*" | cut -d\- -f2 | sed -z 's/\n/","/g' ); echo "tests=[\"${tests%??}]" >> $GITHUB_OUTPUT ) test: + needs: matrix runs-on: ubuntu-latest timeout-minutes: 45 + concurrency: + group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.container }}-${{ matrix.test }} + cancel-in-progress: true strategy: matrix: - test: ${{ fromJSON(inputs.test) }} + container: ${{ fromJSON(needs.matrix.outputs.container) }} + test: ${{ fromJSON(needs.matrix.outputs.tests) }} + fail-fast: false container: - image: ghcr.io/dracutdevs/${{ inputs.container }} + image: ${{ fromJSON(needs.matrix.outputs.registry) }}/${{ matrix.container }} options: "--privileged -v /dev:/dev" steps: - name: "Checkout Repository" - uses: actions/checkout@v1 + uses: actions/checkout@v4 with: fetch-depth: 0 - - name: "${{ inputs.container }} ${{ matrix.test }}" + - name: "${{ matrix.container }} ${{ matrix.test }}" run: ./tools/test-github.sh "TEST-${{ matrix.test }}" ${{ matrix.test }} diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 60ca1db..1113af0 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -9,11 +9,12 @@ jobs: runs-on: ubuntu-latest steps: - name: Check-out the repo under $GITHUB_WORKSPACE - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Run Commisery - uses: dracutdevs/commisery-action@master + uses: tomtom-international/commisery-action@master with: token: ${{ secrets.GITHUB_TOKEN }} - pull_request: ${{ github.event.number }} - + # don't validate the pull request title + validate-pull-request: false + validate-pull-request-title-bump: false diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7497d6e..a12126e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,16 +18,21 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 + - name: Install dependencies + run: | + sudo apt -y update + sudo apt -y install asciidoc + - name: Build run: bash ${GITHUB_WORKSPACE}/tools/release.sh ${{ inputs.tag }} - name: Release if: ${{ env.new_version }} - uses: softprops/action-gh-release@v0.1.15 + uses: softprops/action-gh-release@v2.0.5 with: tag_name: ${{ env.new_version }} name: dracut-${{ env.new_version }} |