From 1cb6fb8a9b10fc70ba42af8307235072ffbde38e Mon Sep 17 00:00:00 2001 From: Zack Grannan Date: Wed, 29 Nov 2023 22:36:22 -0800 Subject: [PATCH] Windows-specific tests --- .github/workflows/test.yml | 45 +++++++++++++++++++++++++++----------- 1 file changed, 32 insertions(+), 13 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 064e3f37b5f..28a0bed4941 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -230,13 +230,6 @@ jobs: with: java-version: '15' distribution: 'zulu' - - name: Set COMPILATION_TARGET_PRUSTI for Windows - if: matrix.os == 'windows-latest' - run: | - [System.Environment]::SetEnvironmentVariable("COMPILATION_TARGET_PRUSTI", "x86_64-pc-windows-msvc", [System.EnvironmentVariableTarget]::Process) - echo "COMPILATION_TARGET_PRUSTI is now set to $env:COMPILATION_TARGET_PRUSTI" - - name: Echo COMPILATION_TARGET_PRUSTI - run: echo "COMPILATION_TARGET_PRUSTI is set to $COMPILATION_TARGET_PRUSTI" - name: Set up the environment run: python x.py setup - name: Cache cargo @@ -257,13 +250,39 @@ jobs: key: ${{ env.VER_CACHE_KEY_UNIQUE }} # Restore from the most recent cache that matches a shared prefix of the key restore-keys: ${{ env.VER_CACHE_KEY_SHARED }} - - name: Build with cargo - run: python x.py build --all --jobs 1 ${{ matrix.os == 'windows-latest' && '--target x86_64-pc-windows-msvc' || '' }} - - name: Run cargo tests - run: python x.py test --all ${{ matrix.os == 'windows-latest' && '--target x86_64-pc-windows-msvc' || '' }} - - name: Run a subset of tests with Carbon + - name: Build with cargo (Windows) + if: matrix.os == 'windows-latest' + run: python x.py build --all --jobs 1 --target x86_64-pc-windows-msvc + shell: powershell + + - name: Build with cargo (Non-Windows) + if: matrix.os != 'windows-latest' + run: python x.py build --all --jobs 1 + + - name: Run cargo tests (Windows) + if: matrix.os == 'windows-latest' + run: | + $env:COMPILATION_TARGET_PRUSTI="x86_64-pc-windows-msvc" + python x.py test --all --target x86_64-pc-windows-msvc + shell: powershell + + - name: Run cargo tests (Non-Windows) + if: matrix.os != 'windows-latest' + run: python x.py test --all + + - name: Run a subset of tests with Carbon (Windows) + if: matrix.os == 'windows-latest' + run: | + $env:COMPILATION_TARGET_PRUSTI="x86_64-pc-windows-msvc" + python x.py test pass/no-annotation --all --verbose --target x86_64-pc-windows-msvc + shell: powershell + env: + PRUSTI_VIPER_BACKEND: carbon + + - name: Run a subset of tests with Carbon (Non-Windows) + if: matrix.os != 'windows-latest' run: | - python x.py test pass/no-annotation --all --verbose ${{ matrix.os == 'windows-latest' && '--target x86_64-pc-windows-msvc' || '' }} + python x.py test pass/no-annotation --all --verbose env: PRUSTI_VIPER_BACKEND: carbon - name: Check prusti-contracts