Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 58 additions & 3 deletions .github/workflows/ci.yml → .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
name: CI

on:
push:
branches: [main]
push: {}
pull_request:
branches: [main]
workflow_dispatch:
Expand Down Expand Up @@ -83,6 +82,20 @@ jobs:
- name: install x86_64-unknown-uefi
run: rustup target add x86_64-unknown-uefi

- name: fmt (host)
run: cargo fmt --check

- name: clippy (vck-common, host)
run: cargo clippy -p vck-common -- -D warnings

- name: clippy (vck-windrv)
shell: msys2 {0}
run: |
make clippy-driver

- name: clippy (vck-loader, UEFI target)
run: cargo clippy -p vck-loader -p vck-sample-loader --target x86_64-unknown-uefi -- -D warnings

- name: cargo test (host)
shell: msys2 {0}
run: cargo test -p vck-common
Expand All @@ -94,7 +107,7 @@ jobs:
- uses: actions/upload-artifact@v7
with:
name: vck-artifacts-${{ github.run_id }}
# vck-sample-driver.sys, vck-driver-pkg/, vck-sample-loader.efi, vck-app.exe
# vck-sample-driver.sys, vck-windrv-pkg/, vck-sample-loader.efi, vck-app.exe
path: testing/artifacts/

# ── VM tests (parallel matrix) ─────────────────────────────────────────────
Expand Down Expand Up @@ -169,3 +182,45 @@ jobs:
name: test-results-${{ matrix.suite }}-${{ github.run_id }}
path: testing/results/${{ matrix.suite }}/
if-no-files-found: warn

# ── Publish to crates.io on version tag ────────────────────────────────────
publish:
name: Publish to crates.io
if: startsWith(github.ref, 'refs/tags/v')
needs:
- build-and-test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- name: Verify tag matches Cargo.toml version
run: |
TAG_VERSION="${GITHUB_REF_NAME#v}"
CARGO_VERSION=$(cargo metadata --no-deps --format-version 1 \
| jq -r '.packages[] | select(.name=="vck-common") | .version')
if [ "$TAG_VERSION" != "$CARGO_VERSION" ]; then
echo "Version mismatch: tag=${TAG_VERSION}, Cargo.toml=${CARGO_VERSION}"
exit 1
fi
echo "Version verified: ${CARGO_VERSION}"

- id: auth
uses: rust-lang/crates-io-auth-action@v1

- name: Publish vck-common
shell: msys2 {0}
env:
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
run: cargo publish -p vck-common

- name: Publish vck-windrv
shell: msys2 {0}
env:
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
run: cargo publish -p vck-windrv --no-verify

- name: Publish vck-loader
shell: msys2 {0}
env:
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
run: cargo publish -p vck-loader --no-verify
Loading
Loading