diff --git a/.github/workflows/integration-windows.yaml b/.github/workflows/integration-windows.yaml new file mode 100644 index 00000000..f2fcea5d --- /dev/null +++ b/.github/workflows/integration-windows.yaml @@ -0,0 +1,43 @@ +name: Rust Hypervisor Firmware Tests (Windows Guest) +on: [pull_request, merge_group] + +jobs: + build: + name: Tests (Windows Guest) + runs-on: ${{ github.event_name == 'pull_request' && 'ubuntu-latest' || 'garm-jammy-16' }} + steps: + - name: Code checkout + if: ${{ github.event_name != 'pull_request' }} + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Install Docker + if: ${{ github.event_name != 'pull_request' }} + run: | + sudo apt-get update + 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 + sudo chmod a+r /usr/share/keyrings/docker-archive-keyring.gpg + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null + sudo apt-get update + sudo apt install -y docker-ce docker-ce-cli + - name: Install Azure CLI + if: ${{ github.event_name != 'pull_request' }} + run: | + 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 + echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ jammy main" | sudo tee /etc/apt/sources.list.d/azure-cli.list + sudo apt update + sudo apt install -y azure-cli + - name: Download Windows image + if: ${{ github.event_name != 'pull_request' }} + run: | + 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 }}" + - name: Run Windows guest integration tests + if: ${{ github.event_name != 'pull_request' }} + timeout-minutes: 60 + run: scripts/dev_cli.sh tests --integration-windows + - name: Skipping build for PR + if: ${{ github.event_name == 'pull_request' }} + run: echo "Skipping build for PR" diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index 3ac2edf2..00000000 --- a/Jenkinsfile +++ /dev/null @@ -1,37 +0,0 @@ -pipeline { - agent none - stages { - stage ('Build') { - parallel { - stage ('Windows guest Tests') { - agent { node { label 'focal-fw' } } - environment { - AZURE_CONNECTION_STRING = credentials('46b4e7d6-315f-4cc1-8333-b58780863b9b') - } - stages { - stage ('Checkout') { - steps { - checkout scm - } - } - stage ('Download assets') { - steps { - sh "sudo apt install -y azure-cli" - sh "mkdir -p ${env.HOME}/workloads" - sh 'az storage blob download --container-name private-images --file "$HOME/workloads/windows-server-2019.raw" --name windows-server-2019.raw --connection-string "$AZURE_CONNECTION_STRING"' - } - } - stage('Run Windows guest integration tests') { - options { - timeout(time: 1, unit: 'HOURS') - } - steps { - sh "scripts/dev_cli.sh tests --integration-windows" - } - } - } - } - } - } - } -} diff --git a/scripts/run_integration_tests_windows.sh b/scripts/run_integration_tests_windows.sh index b389fbc0..fcc5e036 100755 --- a/scripts/run_integration_tests_windows.sh +++ b/scripts/run_integration_tests_windows.sh @@ -9,7 +9,7 @@ arch="$(uname -m)" WORKLOADS_DIR="$HOME/workloads" mkdir -p "$WORKLOADS_DIR" -WIN_IMAGE_FILE="$WORKLOADS_DIR/windows-server-2019.raw" +WIN_IMAGE_FILE="$WORKLOADS_DIR/windows-server-2022-amd64-2.raw" # Check if the image is present if [ ! -f "$WIN_IMAGE_FILE" ]; then diff --git a/src/integration.rs b/src/integration.rs index 68dabe9e..9e144a08 100644 --- a/src/integration.rs +++ b/src/integration.rs @@ -672,7 +672,7 @@ mod tests { mod windows { use crate::integration::tests::*; - const WINDOWS_IMAGE_NAME: &str = "windows-server-2019.raw"; + const WINDOWS_IMAGE_NAME: &str = "windows-server-2022-amd64-2.raw"; fn windows_auth() -> PasswordAuth { PasswordAuth {