mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
ci: Use set -eufo pipefail
Most scripts can use it and it is good at catching errors. Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
This commit is contained in:
committed by
Bo Chen
parent
23e139c0f8
commit
5b67b8994a
1
.github/workflows/dco.yaml
vendored
1
.github/workflows/dco.yaml
vendored
@@ -16,5 +16,6 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
|
set -eufo pipefail
|
||||||
pip3 install -U dco-check
|
pip3 install -U dco-check
|
||||||
dco-check -e "49699333+dependabot[bot]@users.noreply.github.com"
|
dco-check -e "49699333+dependabot[bot]@users.noreply.github.com"
|
||||||
|
|||||||
2
.github/workflows/integration-arm64.yaml
vendored
2
.github/workflows/integration-arm64.yaml
vendored
@@ -31,6 +31,7 @@ jobs:
|
|||||||
- name: Install Azure CLI
|
- name: Install Azure CLI
|
||||||
if: ${{ github.event_name != 'pull_request' }}
|
if: ${{ github.event_name != 'pull_request' }}
|
||||||
run: |
|
run: |
|
||||||
|
set -eufo pipefail
|
||||||
sudo apt install -y ca-certificates curl apt-transport-https lsb-release gnupg
|
sudo apt install -y ca-certificates curl apt-transport-https lsb-release gnupg
|
||||||
curl -sL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/microsoft.gpg > /dev/null
|
curl -sL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/microsoft.gpg > /dev/null
|
||||||
echo "deb [arch=arm64] https://packages.microsoft.com/repos/azure-cli/ bookworm main" | sudo tee /etc/apt/sources.list.d/azure-cli.list
|
echo "deb [arch=arm64] https://packages.microsoft.com/repos/azure-cli/ bookworm main" | sudo tee /etc/apt/sources.list.d/azure-cli.list
|
||||||
@@ -40,6 +41,7 @@ jobs:
|
|||||||
if: ${{ github.event_name != 'pull_request' }}
|
if: ${{ github.event_name != 'pull_request' }}
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
set -eufo pipefail
|
||||||
IMG_BASENAME=windows-11-iot-enterprise-aarch64.raw
|
IMG_BASENAME=windows-11-iot-enterprise-aarch64.raw
|
||||||
IMG_PATH=$HOME/workloads/$IMG_BASENAME
|
IMG_PATH=$HOME/workloads/$IMG_BASENAME
|
||||||
IMG_GZ_PATH=$HOME/workloads/$IMG_BASENAME.gz
|
IMG_GZ_PATH=$HOME/workloads/$IMG_BASENAME.gz
|
||||||
|
|||||||
3
.github/workflows/integration-windows.yaml
vendored
3
.github/workflows/integration-windows.yaml
vendored
@@ -17,6 +17,7 @@ jobs:
|
|||||||
- name: Install Docker
|
- name: Install Docker
|
||||||
if: ${{ github.event_name != 'pull_request' }}
|
if: ${{ github.event_name != 'pull_request' }}
|
||||||
run: |
|
run: |
|
||||||
|
set -eufo pipefail
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get -y install ca-certificates curl gnupg
|
sudo apt-get -y install ca-certificates curl gnupg
|
||||||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
|
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
|
||||||
@@ -27,6 +28,7 @@ jobs:
|
|||||||
- name: Install Azure CLI
|
- name: Install Azure CLI
|
||||||
if: ${{ github.event_name != 'pull_request' }}
|
if: ${{ github.event_name != 'pull_request' }}
|
||||||
run: |
|
run: |
|
||||||
|
set -eufo pipefail
|
||||||
sudo apt install -y ca-certificates curl apt-transport-https lsb-release gnupg
|
sudo apt install -y ca-certificates curl apt-transport-https lsb-release gnupg
|
||||||
curl -sL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/microsoft.gpg > /dev/null
|
curl -sL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/microsoft.gpg > /dev/null
|
||||||
echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ jammy main" | sudo tee /etc/apt/sources.list.d/azure-cli.list
|
echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ jammy main" | sudo tee /etc/apt/sources.list.d/azure-cli.list
|
||||||
@@ -35,6 +37,7 @@ jobs:
|
|||||||
- name: Download Windows image
|
- name: Download Windows image
|
||||||
if: ${{ github.event_name != 'pull_request' }}
|
if: ${{ github.event_name != 'pull_request' }}
|
||||||
run: |
|
run: |
|
||||||
|
set -eufo pipefail
|
||||||
mkdir $HOME/workloads
|
mkdir $HOME/workloads
|
||||||
az storage blob download --container-name private-images --file "$HOME/workloads/windows-server-2022-amd64-2.raw" --name windows-server-2022-amd64-2.raw --connection-string "${{ secrets.CH_PRIVATE_IMAGES }}"
|
az storage blob download --container-name private-images --file "$HOME/workloads/windows-server-2022-amd64-2.raw" --name windows-server-2022-amd64-2.raw --connection-string "${{ secrets.CH_PRIVATE_IMAGES }}"
|
||||||
- name: Run Windows guest integration tests
|
- name: Run Windows guest integration tests
|
||||||
|
|||||||
1
.github/workflows/integration-x86-64.yaml
vendored
1
.github/workflows/integration-x86-64.yaml
vendored
@@ -23,6 +23,7 @@ jobs:
|
|||||||
- name: Install Docker
|
- name: Install Docker
|
||||||
if: ${{ github.event_name != 'pull_request' || (matrix.runner == 'garm-jammy' && matrix.libc == 'gnu') }}
|
if: ${{ github.event_name != 'pull_request' || (matrix.runner == 'garm-jammy' && matrix.libc == 'gnu') }}
|
||||||
run: |
|
run: |
|
||||||
|
set -eufo pipefail
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get -y install ca-certificates curl gnupg
|
sudo apt-get -y install ca-certificates curl gnupg
|
||||||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
|
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
|
||||||
|
|||||||
1
.github/workflows/lychee.yaml
vendored
1
.github/workflows/lychee.yaml
vendored
@@ -20,6 +20,7 @@ jobs:
|
|||||||
# NEW STEP: Print all changed-files outputs for verification
|
# NEW STEP: Print all changed-files outputs for verification
|
||||||
- name: Verify Changed Files
|
- name: Verify Changed Files
|
||||||
run: |
|
run: |
|
||||||
|
set -eufo pipefail
|
||||||
echo "--- tj-actions/changed-files Outputs ---"
|
echo "--- tj-actions/changed-files Outputs ---"
|
||||||
echo "any_changed: ${{ steps.changed-files.outputs.any_changed }}"
|
echo "any_changed: ${{ steps.changed-files.outputs.any_changed }}"
|
||||||
echo "all_changed_files: ${{ steps.changed-files.outputs.all_changed_files }}"
|
echo "all_changed_files: ${{ steps.changed-files.outputs.all_changed_files }}"
|
||||||
|
|||||||
18
.github/workflows/mshv-infra.yaml
vendored
18
.github/workflows/mshv-infra.yaml
vendored
@@ -59,7 +59,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
MI_CLIENT_ID: ${{ secrets.MI_CLIENT_ID }}
|
MI_CLIENT_ID: ${{ secrets.MI_CLIENT_ID }}
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -eufo pipefail
|
||||||
echo "Installing Azure CLI if not already installed"
|
echo "Installing Azure CLI if not already installed"
|
||||||
if ! command -v az &>/dev/null; then
|
if ! command -v az &>/dev/null; then
|
||||||
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
|
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
|
||||||
@@ -76,7 +76,7 @@ jobs:
|
|||||||
SKU: ${{ inputs.VM_SKU }}
|
SKU: ${{ inputs.VM_SKU }}
|
||||||
STORAGE_ACCOUNT_PATHS: ${{ secrets.STORAGE_ACCOUNT_PATHS }}
|
STORAGE_ACCOUNT_PATHS: ${{ secrets.STORAGE_ACCOUNT_PATHS }}
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -eufo pipefail
|
||||||
# Extract vCPU count from SKU (e.g., "Standard_D2s_v3" => 2)
|
# Extract vCPU count from SKU (e.g., "Standard_D2s_v3" => 2)
|
||||||
vcpu=$(echo "$SKU" | sed -n 's/^Standard_[A-Za-z]\+\([0-9]\+\).*/\1/p')
|
vcpu=$(echo "$SKU" | sed -n 's/^Standard_[A-Za-z]\+\([0-9]\+\).*/\1/p')
|
||||||
if [[ -z "$vcpu" ]]; then
|
if [[ -z "$vcpu" ]]; then
|
||||||
@@ -114,7 +114,7 @@ jobs:
|
|||||||
RG: ${{ inputs.RG }}
|
RG: ${{ inputs.RG }}
|
||||||
STORAGE_ACCOUNT_PATHS: ${{ secrets.STORAGE_ACCOUNT_PATHS }}
|
STORAGE_ACCOUNT_PATHS: ${{ secrets.STORAGE_ACCOUNT_PATHS }}
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -eufo pipefail
|
||||||
echo "Creating Resource Group: $RG"
|
echo "Creating Resource Group: $RG"
|
||||||
# Create the resource group
|
# Create the resource group
|
||||||
echo "Creating resource group in location: ${LOCATION}"
|
echo "Creating resource group in location: ${LOCATION}"
|
||||||
@@ -127,7 +127,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
KEY: ${{ inputs.KEY }}
|
KEY: ${{ inputs.KEY }}
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -eufo pipefail
|
||||||
echo "Generating SSH key: $KEY"
|
echo "Generating SSH key: $KEY"
|
||||||
mkdir -p ~/.ssh
|
mkdir -p ~/.ssh
|
||||||
ssh-keygen -t rsa -b 4096 -f ~/.ssh/"${KEY}" -N ""
|
ssh-keygen -t rsa -b 4096 -f ~/.ssh/"${KEY}" -N ""
|
||||||
@@ -145,7 +145,7 @@ jobs:
|
|||||||
VM_IMAGE_NAME: ${{ inputs.ARCH }}_${{ steps.get-location.outputs.location }}_image
|
VM_IMAGE_NAME: ${{ inputs.ARCH }}_${{ steps.get-location.outputs.location }}_image
|
||||||
VM_NAME: ${{ inputs.ARCH }}_${{ steps.get-location.outputs.location }}_${{ github.run_id }}
|
VM_NAME: ${{ inputs.ARCH }}_${{ steps.get-location.outputs.location }}_${{ github.run_id }}
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -eufo pipefail
|
||||||
echo "Creating $VM_SKU VM: $VM_NAME"
|
echo "Creating $VM_SKU VM: $VM_NAME"
|
||||||
|
|
||||||
# Extract subnet ID from the runner VM
|
# Extract subnet ID from the runner VM
|
||||||
@@ -192,7 +192,7 @@ jobs:
|
|||||||
RG: ${{ inputs.RG }}
|
RG: ${{ inputs.RG }}
|
||||||
VM_NAME: ${{ inputs.ARCH }}_${{ steps.get-location.outputs.location }}_${{ github.run_id }}
|
VM_NAME: ${{ inputs.ARCH }}_${{ steps.get-location.outputs.location }}_${{ github.run_id }}
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -eufo pipefail
|
||||||
echo "Retrieving VM Private IP address..."
|
echo "Retrieving VM Private IP address..."
|
||||||
# Retrieve VM Private IP address
|
# Retrieve VM Private IP address
|
||||||
PRIVATE_IP=$(az vm show -g "${RG}" -n "${VM_NAME}" -d --query privateIps -o tsv)
|
PRIVATE_IP=$(az vm show -g "${RG}" -n "${VM_NAME}" -d --query privateIps -o tsv)
|
||||||
@@ -216,7 +216,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
PRIVATE_IP: ${{ steps.get-vm-ip.outputs.PRIVATE_IP }}
|
PRIVATE_IP: ${{ steps.get-vm-ip.outputs.PRIVATE_IP }}
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -eufo pipefail
|
||||||
echo "Removing the old host key"
|
echo "Removing the old host key"
|
||||||
ssh-keygen -R "$PRIVATE_IP"
|
ssh-keygen -R "$PRIVATE_IP"
|
||||||
|
|
||||||
@@ -226,9 +226,9 @@ jobs:
|
|||||||
PRIVATE_IP: ${{ steps.get-vm-ip.outputs.PRIVATE_IP }}
|
PRIVATE_IP: ${{ steps.get-vm-ip.outputs.PRIVATE_IP }}
|
||||||
USERNAME: ${{ secrets.USERNAME }}
|
USERNAME: ${{ secrets.USERNAME }}
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -eufo pipefail
|
||||||
ssh -i ~/.ssh/"${KEY}" -o StrictHostKeyChecking=no -- "${USERNAME}@${PRIVATE_IP}" << EOF
|
ssh -i ~/.ssh/"${KEY}" -o StrictHostKeyChecking=no -- "${USERNAME}@${PRIVATE_IP}" << EOF
|
||||||
set -e
|
set -eufo pipefail
|
||||||
echo "Logged in successfully."
|
echo "Logged in successfully."
|
||||||
echo "Installing dependencies..."
|
echo "Installing dependencies..."
|
||||||
sudo tdnf install -y git moby-engine moby-cli clang llvm pkg-config make gcc glibc-devel
|
sudo tdnf install -y git moby-engine moby-cli clang llvm pkg-config make gcc glibc-devel
|
||||||
|
|||||||
4
.github/workflows/mshv-integration.yaml
vendored
4
.github/workflows/mshv-integration.yaml
vendored
@@ -36,7 +36,7 @@ jobs:
|
|||||||
RG: MSHV-${{ github.run_id }}
|
RG: MSHV-${{ github.run_id }}
|
||||||
USERNAME: ${{ secrets.MSHV_USERNAME }}
|
USERNAME: ${{ secrets.MSHV_USERNAME }}
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -eufo pipefail
|
||||||
echo "Connecting to the VM via SSH..."
|
echo "Connecting to the VM via SSH..."
|
||||||
ssh -i ~/.ssh/"${KEY}" -o StrictHostKeyChecking=no -- "${USERNAME}@${PRIVATE_IP}" << EOF
|
ssh -i ~/.ssh/"${KEY}" -o StrictHostKeyChecking=no -- "${USERNAME}@${PRIVATE_IP}" << EOF
|
||||||
set -e
|
set -e
|
||||||
@@ -96,7 +96,7 @@ jobs:
|
|||||||
RG_NAME: ${{ needs.infra-setup.outputs.RG_NAME }}
|
RG_NAME: ${{ needs.infra-setup.outputs.RG_NAME }}
|
||||||
VM_NAME: ${{ needs.infra-setup.outputs.VM_NAME }}
|
VM_NAME: ${{ needs.infra-setup.outputs.VM_NAME }}
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -eufo pipefail
|
||||||
az vm boot-diagnostics get-boot-log --name "${VM_NAME}" --resource-group "${RG_NAME}" | jq -r
|
az vm boot-diagnostics get-boot-log --name "${VM_NAME}" --resource-group "${RG_NAME}" | jq -r
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
|
|||||||
1
.github/workflows/package-consistency.yaml
vendored
1
.github/workflows/package-consistency.yaml
vendored
@@ -27,6 +27,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Check Rust VMM Package Consistency of fuzz Workspace
|
- name: Check Rust VMM Package Consistency of fuzz Workspace
|
||||||
run: |
|
run: |
|
||||||
|
set -eufo pipefail
|
||||||
pushd fuzz
|
pushd fuzz
|
||||||
python3 ../scripts/package-consistency-check.py github.com/rust-vmm
|
python3 ../scripts/package-consistency-check.py github.com/rust-vmm
|
||||||
popd
|
popd
|
||||||
|
|||||||
2
.github/workflows/quality.yaml
vendored
2
.github/workflows/quality.yaml
vendored
@@ -44,7 +44,7 @@ jobs:
|
|||||||
- name: Bisectability Check (default features)
|
- name: Bisectability Check (default features)
|
||||||
if: ${{ github.event_name == 'pull_request' && matrix.target == 'x86_64-unknown-linux-gnu' }}
|
if: ${{ github.event_name == 'pull_request' && matrix.target == 'x86_64-unknown-linux-gnu' }}
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -eufo pipefail
|
||||||
commits=$(git rev-list origin/${{ github.base_ref }}..${{ github.sha }})
|
commits=$(git rev-list origin/${{ github.base_ref }}..${{ github.sha }})
|
||||||
for commit in $commits; do git checkout $commit; cargo check --tests --examples --all --target=${{ matrix.target }}; done
|
for commit in $commits; do git checkout $commit; cargo check --tests --examples --all --target=${{ matrix.target }}; done
|
||||||
git checkout ${{ github.sha }}
|
git checkout ${{ github.sha }}
|
||||||
|
|||||||
Reference in New Issue
Block a user