-
Notifications
You must be signed in to change notification settings - Fork 1.3k
ci: add Fedora conformance workflow #3086
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
58af731
ci: add Fedora conformance workflow
SDAChess 84a2a98
ci: enable KVM for Fedora conformance
SDAChess 3beda71
ci: run Fedora conformance with KVM
SDAChess 5d71e43
ci: copy Fedora conformance script into guest
SDAChess 112a255
ci: limit conformance VM setup to KVM
SDAChess c9becba
ci: streamline Fedora conformance builds
SDAChess f0b237c
ci: use dev supervisor for Fedora conformance
SDAChess 58ede2a
ci: pin Fedora RPM build image
SDAChess cb0fa14
ci: cache RPM vendoring dependencies
SDAChess a62bcc4
ci: clarify Fedora conformance job name
SDAChess 6ebcbf9
ci: make conformance workflow manual only
SDAChess 8681479
ci(conformance): use new podman rootless install
SDAChess afc6202
fix(ci): build gateway from renamed package
SDAChess File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,123 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| name: Build RPM | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| checkout-ref: | ||
| required: true | ||
| type: string | ||
| arch: | ||
| required: true | ||
| type: string | ||
| runner: | ||
| required: true | ||
| type: string | ||
| cli-target: | ||
| required: true | ||
| type: string | ||
| gateway-target: | ||
| required: true | ||
| type: string | ||
| rpm-version: | ||
| required: false | ||
| type: string | ||
| default: "" | ||
| rpm-release: | ||
| required: false | ||
| type: string | ||
| default: "" | ||
| cargo-version: | ||
| required: false | ||
| type: string | ||
| default: "" | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| defaults: | ||
| run: | ||
| shell: bash | ||
|
|
||
| jobs: | ||
| build: | ||
| name: Build RPM Package (Linux ${{ inputs.arch }}) | ||
| runs-on: ${{ inputs.runner }} | ||
| timeout-minutes: 60 | ||
| container: | ||
| image: docker.io/library/fedora:44@sha256:be9d65e2344d805cc11114319c685ecaa96b6d9b4350a0a6460cdb931babbd19 | ||
| steps: | ||
| - name: Install packaging dependencies | ||
| run: | | ||
| dnf install -y \ | ||
| packit rpm-build \ | ||
| cargo cargo-rpm-macros git-core \ | ||
| pandoc python3-devel systemd-rpm-macros | ||
|
|
||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| ref: ${{ inputs.checkout-ref }} | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Cache Cargo dependencies | ||
| uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2 | ||
| with: | ||
| shared-key: rpm-vendor-${{ inputs.arch }} | ||
| cache-targets: "false" | ||
| cache-bin: "false" | ||
| cache-on-failure: "true" | ||
|
|
||
| - name: Download CLI artifact | ||
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | ||
| with: | ||
| name: openshell-${{ inputs.cli-target }} | ||
| path: package-binaries/ | ||
|
|
||
| - name: Download gateway artifact | ||
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | ||
| with: | ||
| name: openshell-gateway-${{ inputs.gateway-target }} | ||
| path: package-binaries/ | ||
|
|
||
| - name: Configure package inputs | ||
| run: | | ||
| set -euo pipefail | ||
| chmod +x package-binaries/openshell{,-gateway} | ||
| ls -lah package-binaries | ||
|
|
||
| - name: Mark workspace safe for git | ||
| run: git config --global --add safe.directory "$GITHUB_WORKSPACE" | ||
|
|
||
| - name: Fetch tags | ||
| run: git fetch --tags --force | ||
|
|
||
| - name: Build RPMs via Packit | ||
| env: | ||
| OPENSHELL_RPM_VERSION: ${{ inputs.rpm-version }} | ||
| OPENSHELL_RPM_RELEASE: ${{ inputs.rpm-release }} | ||
| OPENSHELL_CARGO_VERSION: ${{ inputs.cargo-version }} | ||
| OPENSHELL_PREBUILT_BINARIES_DIR: ${{ github.workspace }}/package-binaries | ||
| run: packit build locally | ||
|
|
||
| - name: Collect RPM artifacts | ||
| run: | | ||
| set -euo pipefail | ||
| mkdir -p artifacts | ||
| mapfile -t rpms < <(find "$GITHUB_WORKSPACE" -maxdepth 3 -type f -name '*.rpm' ! -name '*.src.rpm' | sort) | ||
| if [ "${#rpms[@]}" -eq 0 ]; then | ||
| echo "::error::No RPM artifacts found under $GITHUB_WORKSPACE" | ||
| find "$GITHUB_WORKSPACE" -maxdepth 3 -type f | sort | ||
| exit 1 | ||
| fi | ||
| cp "${rpms[@]}" artifacts/ | ||
| echo "=== Built RPMs ===" | ||
| ls -lah artifacts/ | ||
|
|
||
| - name: Upload RPM artifacts | ||
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 | ||
| with: | ||
| name: rpm-linux-${{ inputs.arch }} | ||
| path: artifacts/*.rpm | ||
| retention-days: 5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,195 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| name: Conformance | ||
|
|
||
| on: | ||
| workflow_dispatch: {} | ||
|
|
||
| permissions: {} | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| pr_metadata: | ||
| name: Resolve PR metadata | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| pull-requests: read | ||
| outputs: | ||
| should_run: ${{ steps.gate.outputs.should_run }} | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| - id: gate | ||
| uses: ./.github/actions/pr-gate | ||
|
|
||
| version: | ||
| needs: pr_metadata | ||
| if: needs.pr_metadata.outputs.should_run == 'true' | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 5 | ||
| permissions: | ||
| contents: read | ||
| outputs: | ||
| cargo: ${{ steps.version.outputs.cargo }} | ||
| rpm_version: ${{ steps.version.outputs.rpm_version }} | ||
| rpm_release: ${{ steps.version.outputs.rpm_release }} | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Compute versions | ||
| id: version | ||
| run: | | ||
| cargo="$(python3 tasks/scripts/release.py get-version --cargo)" | ||
| rpm_version="$(python3 tasks/scripts/release.py get-version --rpm-version)" | ||
| rpm_release="$(python3 tasks/scripts/release.py get-version --rpm-release)" | ||
| { | ||
| echo "cargo=$cargo" | ||
| echo "rpm_version=$rpm_version" | ||
| echo "rpm_release=$rpm_release" | ||
| } >> "$GITHUB_OUTPUT" | ||
|
SDAChess marked this conversation as resolved.
|
||
|
|
||
| build-cli: | ||
| needs: version | ||
| permissions: | ||
| contents: read | ||
| uses: ./.github/workflows/build-binaries.yml | ||
| with: | ||
| package: openshell-cli | ||
| binary: openshell | ||
| triple: x86_64-unknown-linux-musl | ||
|
elezar marked this conversation as resolved.
|
||
| runner: linux-amd64-cpu8 | ||
| dev-shell: .#devShells.x86_64-linux.musl | ||
| cargo-version: ${{ needs.version.outputs.cargo }} | ||
| checkout-ref: ${{ github.sha }} | ||
| secrets: inherit | ||
|
|
||
| build-conformance: | ||
|
SDAChess marked this conversation as resolved.
|
||
| needs: version | ||
| permissions: | ||
| contents: read | ||
| uses: ./.github/workflows/build-binaries.yml | ||
| with: | ||
| package: openshell-conformance-cli | ||
| binary: openshell-conformance | ||
| triple: x86_64-unknown-linux-musl | ||
| runner: linux-amd64-cpu8 | ||
| dev-shell: .#devShells.x86_64-linux.musl | ||
| cargo-version: ${{ needs.version.outputs.cargo }} | ||
| checkout-ref: ${{ github.sha }} | ||
| secrets: inherit | ||
|
|
||
| build-gateway: | ||
| needs: version | ||
| permissions: | ||
| contents: read | ||
| uses: ./.github/workflows/build-binaries.yml | ||
| with: | ||
| package: openshell-gateway | ||
| binary: openshell-gateway | ||
| triple: x86_64-unknown-linux-gnu | ||
| runner: linux-amd64-cpu8 | ||
| dev-shell: .#devShells.x86_64-linux.glibc-2-28 | ||
| cargo-version: ${{ needs.version.outputs.cargo }} | ||
| image-tag: dev | ||
| interpreter: /lib64/ld-linux-x86-64.so.2 | ||
| checkout-ref: ${{ github.sha }} | ||
| secrets: inherit | ||
|
|
||
| build-rpm: | ||
| needs: [version, build-cli, build-gateway] | ||
| permissions: | ||
| contents: read | ||
| uses: ./.github/workflows/build-rpm.yml | ||
| with: | ||
| checkout-ref: ${{ github.sha }} | ||
| arch: x86_64 | ||
| runner: linux-amd64-cpu8 | ||
| cli-target: x86_64-unknown-linux-musl | ||
| gateway-target: x86_64-unknown-linux-gnu | ||
|
elezar marked this conversation as resolved.
|
||
| cargo-version: ${{ needs.version.outputs.cargo }} | ||
| rpm-version: ${{ needs.version.outputs.rpm_version }} | ||
| rpm-release: ${{ needs.version.outputs.rpm_release }} | ||
|
|
||
| fedora: | ||
| name: Fedora with Rootless Podman | ||
| needs: [build-conformance, build-rpm] | ||
| runs-on: ubuntu-24.04 | ||
| timeout-minutes: 45 | ||
| permissions: | ||
| actions: read | ||
| contents: read | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Enable KVM access | ||
| run: | | ||
| set -euo pipefail | ||
| if [[ ! -c /dev/kvm ]]; then | ||
| echo "::error::The runner did not expose /dev/kvm" | ||
| exit 1 | ||
| fi | ||
| sudo chmod 0666 /dev/kvm | ||
| exec 3<>/dev/kvm | ||
| exec 3>&- | ||
|
|
||
| - uses: ./.github/actions/setup-nix | ||
|
|
||
| - name: Download RPM artifacts | ||
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | ||
| with: | ||
| name: rpm-linux-x86_64 | ||
| path: rpm-input | ||
|
|
||
| - name: Download conformance CLI | ||
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | ||
| with: | ||
| name: openshell-conformance-x86_64-unknown-linux-musl | ||
| path: conformance-input | ||
|
|
||
| - name: Install RPMs and check status | ||
|
SDAChess marked this conversation as resolved.
|
||
| shell: bash | ||
| run: | | ||
| set -euo pipefail | ||
| chmod +x conformance-input/openshell-conformance | ||
|
SDAChess marked this conversation as resolved.
|
||
| guest_script="$RUNNER_TEMP/conformance.sh" | ||
| cat > "$guest_script" <<'EOF' | ||
| set -euo pipefail | ||
|
|
||
| on_exit() { | ||
| rc=$? | ||
| trap - EXIT | ||
| if [ "$rc" -ne 0 ]; then | ||
| systemctl --user status openshell-gateway --no-pager || true | ||
| journalctl --user -u openshell-gateway --no-pager -n 200 || true | ||
| podman info || true | ||
| podman ps --all || true | ||
| getenforce || true | ||
| fi | ||
| exit "$rc" | ||
| } | ||
| trap on_exit EXIT | ||
|
SDAChess marked this conversation as resolved.
|
||
|
|
||
| mkdir -p "$HOME/.config/openshell" | ||
| echo 'OPENSHELL_TELEMETRY_ENABLED=false' > "$HOME/.config/openshell/gateway.env" | ||
| systemctl --user enable --now openshell-gateway | ||
| openshell gateway add --local https://127.0.0.1:17670 --name openshell | ||
| /tmp/openshell-conformance run smoke | ||
|
SDAChess marked this conversation as resolved.
|
||
| EOF | ||
|
|
||
| OPENSHELL_TEST_GUEST_CACHE_DISABLE=1 nix run .#test-guest -- \ | ||
| --distro fedora \ | ||
| --with podman-rootless \ | ||
| --with selinux \ | ||
| --install rpm-input/openshell-[0-9]*.rpm \ | ||
| --install rpm-input/openshell-gateway-[0-9]*.rpm \ | ||
|
SDAChess marked this conversation as resolved.
|
||
| --copy "$guest_script:/tmp/conformance.sh" \ | ||
| --copy conformance-input/openshell-conformance:/tmp/openshell-conformance \ | ||
| -- bash /tmp/conformance.sh | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.