|
| 1 | +name: tmp shell polish |
| 2 | + |
| 3 | +# Temporary: builds and UI-tests the Windows app shell on GitHub's Windows runners. Lives only on |
| 4 | +# tmp/windows-shell-polish. A commit whose message holds [reuse-core] takes the core from the run named in |
| 5 | +# .github/tmp-shell-core-run instead of building it again. |
| 6 | +on: |
| 7 | + push: |
| 8 | + branches: [tmp/windows-shell-polish] |
| 9 | + |
| 10 | +permissions: |
| 11 | + contents: read |
| 12 | + actions: read |
| 13 | + |
| 14 | +concurrency: |
| 15 | + group: tmp-shell-polish |
| 16 | + cancel-in-progress: true |
| 17 | + |
| 18 | +env: |
| 19 | + DOTNET_CLI_TELEMETRY_OPTOUT: "1" |
| 20 | + DOTNET_NOLOGO: "1" |
| 21 | + UNIFFI_BINDGEN_CS_TAG: v0.11.1+v0.31.0 |
| 22 | + |
| 23 | +jobs: |
| 24 | + core: |
| 25 | + name: core (${{ matrix.name }}) |
| 26 | + if: ${{ !contains(github.event.head_commit.message, '[reuse-core]') }} |
| 27 | + strategy: |
| 28 | + fail-fast: false |
| 29 | + matrix: |
| 30 | + include: |
| 31 | + - name: x64 |
| 32 | + runner: windows-2025 |
| 33 | + target: x86_64-pc-windows-msvc |
| 34 | + - name: arm64 |
| 35 | + runner: windows-11-arm |
| 36 | + target: aarch64-pc-windows-msvc |
| 37 | + runs-on: ${{ matrix.runner }} |
| 38 | + timeout-minutes: 150 |
| 39 | + env: |
| 40 | + RUSTFLAGS: -D warnings |
| 41 | + AWS_LC_SYS_PREBUILT_NASM: "1" |
| 42 | + defaults: |
| 43 | + run: |
| 44 | + shell: bash |
| 45 | + steps: |
| 46 | + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 47 | + with: |
| 48 | + persist-credentials: false |
| 49 | + - uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # master |
| 50 | + with: |
| 51 | + toolchain: "1.98" |
| 52 | + targets: ${{ matrix.target }} |
| 53 | + - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3 |
| 54 | + with: |
| 55 | + key: tmp-shell-${{ matrix.target }} |
| 56 | + - name: Drop the emptied DuckDB sources |
| 57 | + run: rm -rf "target/${{ matrix.target }}/duckdb-sources" target/duckdb-sources |
| 58 | + - name: Build the core |
| 59 | + run: cargo build --locked -p tablepro-ffi --target "${{ matrix.target }}" --profile dev |
| 60 | + - name: The core's tests |
| 61 | + run: cargo test --locked -p tablepro-ffi --target "${{ matrix.target }}" |
| 62 | + - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 |
| 63 | + with: |
| 64 | + name: core-${{ matrix.name }} |
| 65 | + path: target/${{ matrix.target }}/debug/tablepro_ffi.dll |
| 66 | + |
| 67 | + bindings: |
| 68 | + name: bindings and core tests (macOS) |
| 69 | + runs-on: macos-15 |
| 70 | + timeout-minutes: 120 |
| 71 | + env: |
| 72 | + RUSTFLAGS: -D warnings |
| 73 | + defaults: |
| 74 | + run: |
| 75 | + shell: bash |
| 76 | + steps: |
| 77 | + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 78 | + with: |
| 79 | + persist-credentials: false |
| 80 | + - uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # master |
| 81 | + with: |
| 82 | + toolchain: "1.98" |
| 83 | + targets: aarch64-apple-darwin |
| 84 | + - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3 |
| 85 | + with: |
| 86 | + key: tmp-shell-macos |
| 87 | + - name: Drop the emptied DuckDB sources |
| 88 | + run: rm -rf target/aarch64-apple-darwin/duckdb-sources target/duckdb-sources |
| 89 | + - uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0 |
| 90 | + with: |
| 91 | + dotnet-version: 10.0.x |
| 92 | + - name: The core's tests |
| 93 | + run: cargo test --locked -p tablepro-ffi -p tablepro-core -p tablepro-storage --lib --tests |
| 94 | + - name: Install uniffi-bindgen-cs |
| 95 | + env: |
| 96 | + RUSTFLAGS: "" |
| 97 | + run: | |
| 98 | + cargo install uniffi-bindgen-cs --locked --root ~/.uniffi-bindgen-cs \ |
| 99 | + --git https://github.com/NordSecurity/uniffi-bindgen-cs --tag "$UNIFFI_BINDGEN_CS_TAG" |
| 100 | + - name: The committed bindings match the library |
| 101 | + working-directory: windows |
| 102 | + run: | |
| 103 | + dotnet msbuild src/TablePro.Interop -t:GenerateBindings -p:UniffiBindgenCs="$HOME/.uniffi-bindgen-cs/bin/uniffi-bindgen-cs" |
| 104 | + git diff --stat -- src/TablePro.Interop/Generated |
| 105 | + test -z "$(git status --porcelain -- src/TablePro.Interop/Generated)" |
| 106 | + - name: The .NET tests on macOS |
| 107 | + working-directory: windows |
| 108 | + run: dotnet test --solution TablePro.slnx |
| 109 | + |
| 110 | + app: |
| 111 | + name: app (${{ matrix.name }}) |
| 112 | + needs: core |
| 113 | + if: ${{ always() && (needs.core.result == 'success' || needs.core.result == 'skipped') }} |
| 114 | + strategy: |
| 115 | + fail-fast: false |
| 116 | + matrix: |
| 117 | + include: |
| 118 | + - name: x64 |
| 119 | + runner: windows-2025 |
| 120 | + target: x86_64-pc-windows-msvc |
| 121 | + rid: win-x64 |
| 122 | + platform: x64 |
| 123 | + - name: arm64 |
| 124 | + runner: windows-11-arm |
| 125 | + target: aarch64-pc-windows-msvc |
| 126 | + rid: win-arm64 |
| 127 | + platform: ARM64 |
| 128 | + runs-on: ${{ matrix.runner }} |
| 129 | + timeout-minutes: 90 |
| 130 | + defaults: |
| 131 | + run: |
| 132 | + shell: bash |
| 133 | + steps: |
| 134 | + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 135 | + with: |
| 136 | + persist-credentials: false |
| 137 | + - name: Which run built the core |
| 138 | + id: core |
| 139 | + run: | |
| 140 | + if [ "${{ needs.core.result }}" = "skipped" ]; then |
| 141 | + echo "run=$(tr -d '[:space:]' < .github/tmp-shell-core-run)" >> "$GITHUB_OUTPUT" |
| 142 | + else |
| 143 | + echo "run=${{ github.run_id }}" >> "$GITHUB_OUTPUT" |
| 144 | + fi |
| 145 | + - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 |
| 146 | + with: |
| 147 | + name: core-${{ matrix.name }} |
| 148 | + path: target/${{ matrix.target }}/debug |
| 149 | + run-id: ${{ steps.core.outputs.run }} |
| 150 | + github-token: ${{ github.token }} |
| 151 | + - uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0 |
| 152 | + with: |
| 153 | + dotnet-version: 10.0.x |
| 154 | + - name: The .NET tests |
| 155 | + working-directory: windows |
| 156 | + run: dotnet test --solution TablePro.slnx -p:SkipCoreBuild=true |
| 157 | + - name: Build the app |
| 158 | + working-directory: windows |
| 159 | + run: dotnet build src/TablePro.App -r "${{ matrix.rid }}" -p:Platform="${{ matrix.platform }}" -p:SkipCoreBuild=true |
| 160 | + - name: Prepare the desktop |
| 161 | + shell: pwsh |
| 162 | + run: | |
| 163 | + . windows/ci/desktop.ps1 |
| 164 | + Clear-FirstLogon |
| 165 | + Start-WslWatch "$env:GITHUB_WORKSPACE/windows/tests/TablePro.App.UITests/TestResults/wsl-watch.log" |
| 166 | + Set-Display 1920 1080 |
| 167 | + - name: UI tests |
| 168 | + working-directory: windows |
| 169 | + env: |
| 170 | + TABLEPRO_UI_SCREENSHOTS: ${{ github.workspace }}/screenshots |
| 171 | + run: | |
| 172 | + TABLEPRO_APP=$(find "$PWD/src/TablePro.App/bin" -name TablePro.exe | head -1) |
| 173 | + export TABLEPRO_APP |
| 174 | + dotnet test --project tests/TablePro.App.UITests |
| 175 | + - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 |
| 176 | + if: always() |
| 177 | + with: |
| 178 | + name: screenshots-${{ matrix.name }} |
| 179 | + path: screenshots |
| 180 | + if-no-files-found: ignore |
| 181 | + - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 |
| 182 | + if: always() |
| 183 | + with: |
| 184 | + name: test-results-${{ matrix.name }} |
| 185 | + path: windows/**/TestResults/** |
| 186 | + if-no-files-found: ignore |
0 commit comments