build(deps): bump rust-vmm-ci from 8455080 to bfca469
#226
Workflow file for this run
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
| name: Build & Test MSHV Crate | |
| on: | |
| pull_request_target: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| infra-setup: | |
| name: MSHV Infra Setup (x86_64) | |
| uses: ./.github/workflows/mshv-infra.yaml | |
| with: | |
| ARCH: x86_64 | |
| KEY: azure_key_${{ github.run_id }} | |
| OS_DISK_SIZE: 512 | |
| RG: RUST-VMM-MSHV-${{ github.run_id }} | |
| VM_SKU: Standard_D16s_v5 | |
| secrets: | |
| MI_CLIENT_ID: ${{ secrets.MSHV_MI_CLIENT_ID }} | |
| RUNNER_RG: ${{ secrets.MSHV_RUNNER_RG }} | |
| STORAGE_ACCOUNT_PATHS: ${{ secrets.MSHV_STORAGE_ACCOUNT_PATHS }} | |
| ARCH_SOURCE_PATH: ${{ secrets.MSHV_X86_SOURCE_PATH }} | |
| USERNAME: ${{ secrets.MSHV_USERNAME }} | |
| build-test: | |
| name: Build & test | |
| needs: infra-setup | |
| if: ${{ always() && needs.infra-setup.result == 'success' }} | |
| runs-on: | |
| - self-hosted | |
| - Linux | |
| steps: | |
| - name: Build & Run tests on remote VM | |
| env: | |
| KEY: azure_key_${{ github.run_id }} | |
| PR_NUMBER: ${{ github.event.pull_request.number }} | |
| PRIVATE_IP: ${{ needs.infra-setup.outputs.PRIVATE_IP }} | |
| REPO_URL: https://github.com/rust-vmm/mshv.git | |
| REPO_DIR: mshv | |
| RG: MSHV-${{ github.run_id }} | |
| USERNAME: ${{ secrets.MSHV_USERNAME }} | |
| run: | | |
| set -e | |
| echo "Connecting to the VM via SSH..." | |
| ssh -i ~/.ssh/${KEY} -o StrictHostKeyChecking=no ${USERNAME}@${PRIVATE_IP} << EOF | |
| set -e | |
| echo "Logged in successfully." | |
| export PATH="\$HOME/.cargo/bin:\$PATH" | |
| if [[ "${{ github.event_name }}" == "pull_request_target" ]]; then | |
| git clone --depth 1 "$REPO_URL" "$REPO_DIR" | |
| cd "$REPO_DIR" | |
| git fetch origin pull/${{ github.event.pull_request.number }}/merge | |
| git checkout FETCH_HEAD | |
| else | |
| git clone --depth 1 --single-branch --branch "${{ github.ref_name }}" "$REPO_URL" "$REPO_DIR" | |
| cd "$REPO_DIR" | |
| fi | |
| cargo build --all-features --workspace | |
| cargo test --all-features --workspace | |
| EOF | |
| echo "Build and test completed successfully." | |
| cleanup: | |
| name: Cleanup | |
| needs: build-test | |
| if: always() | |
| runs-on: | |
| - self-hosted | |
| - Linux | |
| steps: | |
| - name: Delete RG | |
| env: | |
| RG: RUST-VMM-MSHV-${{ github.run_id }} | |
| run: | | |
| if az group exists --name ${RG}; then | |
| az group delete --name ${RG} --yes --no-wait | |
| else | |
| echo "Resource Group ${RG} does not exist. Skipping deletion." | |
| fi | |
| echo "Cleanup process completed." | |
| - name: Delete SSH Key | |
| env: | |
| KEY: azure_key_${{ github.run_id }} | |
| run: | | |
| if [ -f ~/.ssh/${KEY} ]; then | |
| rm -f ~/.ssh/${KEY} ~/.ssh/${KEY}.pub | |
| echo "SSH key deleted successfully." | |
| else | |
| echo "SSH key does not exist. Skipping deletion." | |
| fi | |
| echo "Cleanup process completed." |