From 807d5bfa0691abb76aab2ead00f9c5f87ac83ad9 Mon Sep 17 00:00:00 2001 From: Pascal Welsch Date: Sat, 27 Jul 2024 03:48:09 +0200 Subject: [PATCH 1/9] flutter.exe doesn't exist, use flutter.bat --- sidekick_core/lib/src/flutter.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sidekick_core/lib/src/flutter.dart b/sidekick_core/lib/src/flutter.dart index e78f1580..bf1e2a73 100644 --- a/sidekick_core/lib/src/flutter.dart +++ b/sidekick_core/lib/src/flutter.dart @@ -29,10 +29,11 @@ int flutter( dcli.waitForEx(future); } } + final exe = Platform.isWindows ? sdk.file('bin/flutter.bat') : sdk.file('bin/flutter'); final process = dcli.startFromArgs( - Platform.isWindows ? 'bash' : sdk.file('bin/flutter').path, - [if (Platform.isWindows) sdk.file('bin/flutter.exe').path, ...args], + exe.path, + args, workingDirectory: workingDirectory?.absolute.path, nothrow: nothrow || throwOnError != null, progress: progress, From 6d2214134c3c4122cf7efcfdc0a4f89bfb89089c Mon Sep 17 00:00:00 2001 From: Pascal Welsch Date: Sat, 27 Jul 2024 03:48:41 +0200 Subject: [PATCH 2/9] Explicitly start bash script with bash Fixes execution on windows --- .../lib/src/commands/recompile_command.dart | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/sidekick_core/lib/src/commands/recompile_command.dart b/sidekick_core/lib/src/commands/recompile_command.dart index 7ea5a421..383b9219 100644 --- a/sidekick_core/lib/src/commands/recompile_command.dart +++ b/sidekick_core/lib/src/commands/recompile_command.dart @@ -16,7 +16,19 @@ class RecompileCommand extends Command { Future run() async { final installScript = SidekickContext.sidekickPackage.root.file('tool/install.sh'); - final process = start(installScript.path, nothrow: true, terminal: true); - exitCode = process.exitCode ?? -1; + final bash = which('bash'); + final String bashExe; + if (bash.found) { + bashExe = bash.path!; + } else { + bashExe = '/usr/bin/bash'; + } + final progress = startFromArgs( + bashExe, + [installScript.path], + nothrow: true, + terminal: true, + ); + exitCode = progress.exitCode ?? -1; } } From 4ffe95c196919812d8438c9c015b0e87ab5c6cf7 Mon Sep 17 00:00:00 2001 From: Pascal Welsch Date: Sat, 27 Jul 2024 03:54:17 +0200 Subject: [PATCH 3/9] Setup windows CI --- .github/workflows/integration.yaml | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index 0b564741..547da9bd 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -77,15 +77,25 @@ jobs: ./dashi sidekick plugins install sidekick_vault ./dashi vault -h - integration_tests_windows: + integration_tests_windows_local: runs-on: windows-2022 - - # They don't work yet, but someone should invest time here - if: 'false' steps: - - uses: actions/checkout@v2 - - uses: dart-lang/setup-dart@v1 + - name: Set up Chocolatey + run: Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) + - name: Install Dart SDK + run: choco install dart-sdk --version 3.0 + - name: Set up Dart in PATH + shell: powershell + run: | + $dartSdkPath = (Get-Command dart).Source + $dartSdkDir = Split-Path -Parent $dartSdkPath + echo "::add-path::$dartSdkDir" + - name: Dart version + run: dart --version - name: Install dependencies run: cd sidekick && dart pub get --no-precompile - name: Run tests run: cd sidekick && dart test test/test_runner.dart + env: + SIDEKICK_PUB_DEPS: "false" + SIDEKICK_ANALYZE: "false" \ No newline at end of file From 6b9666542b199e8fc0446aec61b763bf7dfe92bb Mon Sep 17 00:00:00 2001 From: Pascal Welsch Date: Sat, 27 Jul 2024 03:55:29 +0200 Subject: [PATCH 4/9] Trigger CI --- .github/workflows/integration.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index 547da9bd..566e395c 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -4,6 +4,7 @@ on: push: branches: - main + - windows pull_request: schedule: # Every night at 03:00 From 0a51cfff7820f55548e0d5d71034eedf2dc10a1b Mon Sep 17 00:00:00 2001 From: Pascal Welsch Date: Sat, 27 Jul 2024 03:56:38 +0200 Subject: [PATCH 5/9] Fix line-length --- sidekick_core/lib/src/flutter.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sidekick_core/lib/src/flutter.dart b/sidekick_core/lib/src/flutter.dart index bf1e2a73..fc21c4e5 100644 --- a/sidekick_core/lib/src/flutter.dart +++ b/sidekick_core/lib/src/flutter.dart @@ -29,7 +29,9 @@ int flutter( dcli.waitForEx(future); } } - final exe = Platform.isWindows ? sdk.file('bin/flutter.bat') : sdk.file('bin/flutter'); + final exe = Platform.isWindows + ? sdk.file('bin/flutter.bat') + : sdk.file('bin/flutter'); final process = dcli.startFromArgs( exe.path, From 7e11752cf34e02312fa55fb5528928fc36104275 Mon Sep 17 00:00:00 2001 From: Pascal Welsch Date: Sat, 27 Jul 2024 04:00:17 +0200 Subject: [PATCH 6/9] Run tests on windows --- .github/workflows/unit_tests.yaml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/unit_tests.yaml b/.github/workflows/unit_tests.yaml index 31ef6887..3e73b523 100644 --- a/.github/workflows/unit_tests.yaml +++ b/.github/workflows/unit_tests.yaml @@ -20,6 +20,26 @@ jobs: - name: Run tests sidekick_core run: cd sidekick_core && dart test + core_test_windows: + runs-on: windows-2022 + + steps: + - name: Set up Chocolatey + run: Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) + - name: Install Dart SDK + run: choco install dart-sdk --version 3.0.0 + - name: Set up Dart in PATH + shell: powershell + run: | + $dartSdkPath = (Get-Command dart).Source + $dartSdkDir = Split-Path -Parent $dartSdkPath + echo "::add-path::$dartSdkDir" + - uses: actions/checkout@v1 + - name: Install dependencies sidekick_core + run: cd sidekick_core && dart pub get --no-precompile + - name: Run tests sidekick_core + run: cd sidekick_core && dart test + vault_test: runs-on: ubuntu-latest From 91000c8504437f302956157d7a35e51e4b62da81 Mon Sep 17 00:00:00 2001 From: Pascal Welsch Date: Sat, 27 Jul 2024 04:02:39 +0200 Subject: [PATCH 7/9] Set dart path correctly --- .github/workflows/integration.yaml | 7 +++---- .github/workflows/unit_tests.yaml | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index 566e395c..bb1fc3a3 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -85,12 +85,11 @@ jobs: run: Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) - name: Install Dart SDK run: choco install dart-sdk --version 3.0 - - name: Set up Dart in PATH + - name: Add Dart SDK to PATH shell: powershell run: | - $dartSdkPath = (Get-Command dart).Source - $dartSdkDir = Split-Path -Parent $dartSdkPath - echo "::add-path::$dartSdkDir" + $dartSdkPath = "C:\tools\dart-sdk\bin" + echo "::add-path::$dartSdkPath" - name: Dart version run: dart --version - name: Install dependencies diff --git a/.github/workflows/unit_tests.yaml b/.github/workflows/unit_tests.yaml index 3e73b523..198f4744 100644 --- a/.github/workflows/unit_tests.yaml +++ b/.github/workflows/unit_tests.yaml @@ -28,12 +28,11 @@ jobs: run: Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) - name: Install Dart SDK run: choco install dart-sdk --version 3.0.0 - - name: Set up Dart in PATH + - name: Add Dart SDK to PATH shell: powershell run: | - $dartSdkPath = (Get-Command dart).Source - $dartSdkDir = Split-Path -Parent $dartSdkPath - echo "::add-path::$dartSdkDir" + $dartSdkPath = "C:\tools\dart-sdk\bin" + echo "::add-path::$dartSdkPath" - uses: actions/checkout@v1 - name: Install dependencies sidekick_core run: cd sidekick_core && dart pub get --no-precompile From 292b3846e14093a6ac6fd7e608943f7f41a91cb6 Mon Sep 17 00:00:00 2001 From: Pascal Welsch Date: Sat, 27 Jul 2024 04:05:57 +0200 Subject: [PATCH 8/9] Use env files --- .github/workflows/integration.yaml | 4 ++-- .github/workflows/unit_tests.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index bb1fc3a3..eb6ff84f 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -88,8 +88,8 @@ jobs: - name: Add Dart SDK to PATH shell: powershell run: | - $dartSdkPath = "C:\tools\dart-sdk\bin" - echo "::add-path::$dartSdkPath" + $dartSdkPath = "C:\\tools\\dart-sdk\\bin" + echo $dartSdkPath | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - name: Dart version run: dart --version - name: Install dependencies diff --git a/.github/workflows/unit_tests.yaml b/.github/workflows/unit_tests.yaml index 198f4744..f1d52049 100644 --- a/.github/workflows/unit_tests.yaml +++ b/.github/workflows/unit_tests.yaml @@ -31,8 +31,8 @@ jobs: - name: Add Dart SDK to PATH shell: powershell run: | - $dartSdkPath = "C:\tools\dart-sdk\bin" - echo "::add-path::$dartSdkPath" + $dartSdkPath = "C:\\tools\\dart-sdk\\bin" + echo $dartSdkPath | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - uses: actions/checkout@v1 - name: Install dependencies sidekick_core run: cd sidekick_core && dart pub get --no-precompile From f891ac6ed78cae0bace969b6c2cf9b092101a9e6 Mon Sep 17 00:00:00 2001 From: Pascal Welsch Date: Sat, 27 Jul 2024 04:12:17 +0200 Subject: [PATCH 9/9] Add missing checkout --- .github/workflows/integration.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index eb6ff84f..c185bc8f 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -92,6 +92,7 @@ jobs: echo $dartSdkPath | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - name: Dart version run: dart --version + - uses: actions/checkout@v1 - name: Install dependencies run: cd sidekick && dart pub get --no-precompile - name: Run tests