diff options
Diffstat (limited to '.github/workflows')
-rw-r--r-- | .github/workflows/codeql.yml | 53 | ||||
-rw-r--r-- | .github/workflows/container.yml | 56 | ||||
-rw-r--r-- | .github/workflows/integration.yml | 92 | ||||
-rw-r--r-- | .github/workflows/labels.yml | 11 | ||||
-rw-r--r-- | .github/workflows/lint.yml | 38 | ||||
-rw-r--r-- | .github/workflows/manualtest.yml | 38 | ||||
-rw-r--r-- | .github/workflows/pr.yml | 19 | ||||
-rw-r--r-- | .github/workflows/release.yml | 34 |
8 files changed, 341 insertions, 0 deletions
diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..e6f8e42 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,53 @@ +--- +# vi: ts=2 sw=2 et: +# SPDX-License-Identifier: LGPL-2.1-or-later +# +name: "CodeQL" + +on: + push: + branches: + - master + pull_request: + branches: + - master + +permissions: + contents: read + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-22.04 + concurrency: + group: ${{ github.workflow }}-${{ matrix.language }}-${{ github.ref }} + cancel-in-progress: true + permissions: + actions: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: ['cpp', 'python'] + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} + queries: +security-extended,security-and-quality + + - name: Install dependencies + run: | + sudo apt -y update + sudo apt -y install asciidoc gcc libkmod-dev libsystemd-dev pkg-config + + - name: Autobuild + uses: github/codeql-action/autobuild@v2 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml new file mode 100644 index 0000000..d8c8808 --- /dev/null +++ b/.github/workflows/container.yml @@ -0,0 +1,56 @@ +name: Container +on: + schedule: + - cron: '30 11 * * *' # every day at 11:30 UTC + push: + branches: [ master ] + paths: + - 'test/container/**' + - '.github/workflows/container.yml' + pull_request: + branches: [ master ] + paths: + - 'test/container/**' + - '.github/workflows/container.yml' + +permissions: + packages: write + contents: read + +jobs: + push_to_registry: + if: github.repository == 'dracutdevs/dracut' || vars.CONTAINER == 'enabled' + name: Build and push containers image to GitHub Packages + runs-on: ubuntu-latest + concurrency: + group: ${{ 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' } + steps: + - name: Check out the repo + uses: actions/checkout@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + 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@v4 + with: + file: test/container/${{ matrix.config.dockerfile }} + tags: ghcr.io/${{env.repository_owner}}/${{ matrix.config.tag }} + push: ${{ github.event_name == 'push' || github.event_name == 'schedule' }} diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml new file mode 100644 index 0000000..ab075b0 --- /dev/null +++ b/.github/workflows/integration.yml @@ -0,0 +1,92 @@ +name: Integration Test + +on: + pull_request: + branches: [ master ] + +env: + DEBUGFAIL: "${{ secrets.ACTIONS_STEP_DEBUG && 'rd.debug' }}" + +jobs: + test: + runs-on: ubuntu-latest + timeout-minutes: 30 + concurrency: + group: ${{ 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", + ] + test: [ + "01", + "02", + "03", + "04", + "10", + "11", + "12", + "13", + "14", + "15", + "16", + "17", + "18", + "62", + "98", + ] + fail-fast: false + container: + image: ghcr.io/dracutdevs/${{ matrix.container }} + options: "--privileged -v /dev:/dev" + steps: + - name: "Checkout Repository" + uses: actions/checkout@v1 + with: + fetch-depth: 0 + + - name: "${{ matrix.container }} TEST-${{ matrix.test }}" + run: ./tools/test-github.sh "TEST-${{ matrix.test }}" ${{ matrix.test }} + network: + runs-on: ubuntu-latest + timeout-minutes: 45 + concurrency: + group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.container }}-${{ matrix.test }}-${{ matrix.network }} + cancel-in-progress: true + strategy: + matrix: + container: [ + "fedora:latest", + ] + network: [ + "network-manager", + "network-legacy", + #"systemd-networkd", + #"connman", + ] + test: [ + "20", + "30", + "35", + "40", + "60", + # "50", # times out + ] + fail-fast: false + container: + image: ghcr.io/dracutdevs/${{ matrix.container }} + options: "--privileged -v /dev:/dev" + steps: + - name: "Checkout Repository" + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: "${{ matrix.container }} TEST-${{ matrix.test }}" + run: USE_NETWORK=${{ matrix.network }} ./tools/test-github.sh "TEST-${{ matrix.test }}" ${{ matrix.test }} diff --git a/.github/workflows/labels.yml b/.github/workflows/labels.yml new file mode 100644 index 0000000..9fa7a92 --- /dev/null +++ b/.github/workflows/labels.yml @@ -0,0 +1,11 @@ +name: "Pull Request Labeler" + +on: pull_request_target + +jobs: + triage: + runs-on: ubuntu-latest + steps: + - uses: actions/labeler@main + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..d02b332 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,38 @@ +name: Lint + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + lint-shell: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: shfmt + uses: luizm/action-sh-checker@v0.6.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SHFMT_OPTS: -s # arguments to shfmt. + with: + sh_checker_shellcheck_disable: false + sh_checker_comment: true + + lint-c: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: install tools + run: sudo apt-get install astyle + + - name: indent + run: make indent-c + + - name: check formatting + run: git diff --exit-code diff --git a/.github/workflows/manualtest.yml b/.github/workflows/manualtest.yml new file mode 100644 index 0000000..b790dcf --- /dev/null +++ b/.github/workflows/manualtest.yml @@ -0,0 +1,38 @@ +name: Manual test + +on: + workflow_dispatch: + inputs: + test: + description: "Array of tests to run, such as [11,12]" + default: "['04']" + required: true + container: + type: choice + description: 'distro' + default: 'fedora' + options: + - "fedora" + - "arch" + - "debian" + - "ubuntu" + - "opensuse" + - "gentoo" + +jobs: + test: + runs-on: ubuntu-latest + timeout-minutes: 45 + strategy: + matrix: + test: ${{ fromJSON(inputs.test) }} + container: + image: ghcr.io/dracutdevs/${{ inputs.container }} + options: "--privileged -v /dev:/dev" + steps: + - name: "Checkout Repository" + uses: actions/checkout@v1 + with: + fetch-depth: 0 + - name: "${{ inputs.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 new file mode 100644 index 0000000..60ca1db --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,19 @@ +name: Commisery +on: + pull_request: + types: [edited, opened, synchronize, reopened] + +jobs: + commit-message: + name: Conventional Commit Message Checker (Commisery) + runs-on: ubuntu-latest + steps: + - name: Check-out the repo under $GITHUB_WORKSPACE + uses: actions/checkout@v3 + + - name: Run Commisery + uses: dracutdevs/commisery-action@master + with: + token: ${{ secrets.GITHUB_TOKEN }} + pull_request: ${{ github.event.number }} + diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..7497d6e --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,34 @@ +name: Release + +on: + schedule: + ## Schedule the job to run on Apr-1, Aug-1, Dec-1 + - cron: '0 0 1 APR,AUG,DEC *' + workflow_dispatch: + inputs: + tag: + description: "release version number (3 digits)" + required: true + +permissions: + contents: write + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - 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 + with: + tag_name: ${{ env.new_version }} + name: dracut-${{ env.new_version }} + body_path: ${{ github.workspace }}/release.md |