forked from openzfsonwindows/openzfs
-
Notifications
You must be signed in to change notification settings - Fork 1
1937 lines (1479 loc) · 63.7 KB
/
windows-build-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
######################################################################################
# #
# If you're looking for instructions on how to build this under windows go to #
#https://github.com/openzfsonwindows/openzfs/blob/windows/module/os/windows/README.md#
# #
######################################################################################
name: windows-build-test
on:
push:
pull_request:
workflow_dispatch:
inputs:
run-failing:
type: boolean
default: true
description: Run tests that fail
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Debug
jobs:
build_windows:
timeout-minutes: 30
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
# You can convert this to a matrix build if you need cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: windows-latest
steps:
- uses: ilammy/msvc-dev-cmd@v1
- uses: actions/checkout@v3
with:
#repository: openzfsonwindows/openzfs
fetch-depth: 0
- name: debug - git status
run: git status
#https://stackoverflow.com/a/60883893
# "C:\Program Files\Git\bin\git.exe" -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +90acd8f20e6d0c14b83241cc7dcd17df27d5a95b:refs/remotes/origin/andrew_workflows-7
#- name: checkout again
# run: git fetch --prune --unshallow
- name: Import signing certificate
run: |
$plaintextpwd = 'password1234'
$pwd = ConvertTo-SecureString -String $plaintextpwd -Force -AsPlainText
Import-PfxCertificate -FilePath ${{github.workspace}}/contrib/windows/TestCert/test_sign_cert_pass.pfx -CertStoreLocation Cert:\CurrentUser\My -Password $pwd -Exportable
#- name: Remove provided ssl
# run: Remove-Item -Path "C:\Strawberry\" -Recurse -Force
#- name: Install openssl
# run: git clone https://github.com/andrewc12/openssl.git
- name: Checkout openssl
uses: actions/checkout@v3
with:
repository: andrewc12/openssl # optional, default is ${{ github.repository }}
path: openssl # optional
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -G "Ninja" -B ${{github.workspace}}/out/build/x64-Debug ${{github.workspace}} -DOPENSSL_ROOT_DIR=${{github.workspace}}/openssl/ -DCRYPTO_STATIC_TEST=${{github.workspace}}/openssl/lib/VC/static/libcrypto64MTd.lib -DLIB_EAY_DEBUG=${{github.workspace}}/openssl/lib/VC/static/libcrypto64MTd.lib -DLIB_EAY_RELEASE=${{github.workspace}}/openssl/lib/VC/static/libcrypto64MT.lib -DOPENSSL_INCLUDE_DIR=${{github.workspace}}/openssl/include -DSSL_EAY_DEBUG=${{github.workspace}}/openssl/lib/VC/static/libssl64MTd.lib -DSSL_EAY_RELEASE=${{github.workspace}}/openssl/lib/VC/static/libssl64MT.lib
- name: Build
working-directory: ${{github.workspace}}/out/build/x64-Debug
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/out/build/x64-Debug
- name: debug - get git rev
run: git describe --always --long --dirty
- name: Download Inno Setup istaller
uses: suisei-cn/[email protected]
id: innoinstaller
with:
url: 'https://jrsoftware.org/download.php/is.exe'
target: ${{github.workspace}}/
- name: debug - echo filename
run: echo ${{ steps.innoinstaller.outputs.filename }}
- name: debug - list
run: ls ${{github.workspace}}\
- name: debug - list
run: ls ${{github.workspace}}\${{ steps.innoinstaller.outputs.filename }}
- name: install inno
run: 'Start-Process -FilePath "${{github.workspace}}\${{ steps.innoinstaller.outputs.filename }}" -Wait -ArgumentList "/NORESTART /ALLUSERS /VERYSILENT /LOG=`"${{github.workspace}}\InnoSetup-Install.log`""'
#- name: Wait for install to finish
# run: Start-Sleep -Seconds 30
# uses: iFaxity/wait-on-action@v1
# with:
# resource: 'C:\Program Files\OpenZFS On Windows\zpool.exe'
- name: debug - print log
run: cat "${{github.workspace}}\InnoSetup-Install.log"
- name: run ISCC.exe to construct OpenZFS installer
run: '&"C:\Program Files (x86)\Inno Setup 6\ISCC.exe" .\ZFSInstall-debug.iss "/Ssigntoolc=C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x64\signtool.exe sign /v /fd sha256 /n `$qOpenZFS Test Signing Certificate`$q /t http://timestamp.digicert.com `$f" | Tee-Object -FilePath "${{github.workspace}}\iscc.log"'
working-directory: ${{github.workspace}}\contrib\windows\Inno.Setup
#- name: debug - get exe name
# https://stackoverflow.com/questions/4426442/unix-tail-equivalent-command-in-windows-powershell
# run: Get-Content "${{github.workspace}}\iscc.log" -Tail 1
- name: get installer exe name
id: innoout
# https://stackoverflow.com/questions/4426442/unix-tail-equivalent-command-in-windows-powershell
#https://www.jamescroft.co.uk/setting-github-actions-environment-variables-in-powershell/
run: |
$p = Get-Content "${{github.workspace}}\iscc.log" -Tail 1
echo $p
$f = (Get-Item $p ).Name
echo $f
echo installername=$f
#echo "installername=$f" >> $GITHUB_ENV
#echo "installername=$f" >> $GITHUB_OUTPUT
echo "installername=$f" | Out-File -FilePath $Env:GITHUB_OUTPUT -Encoding utf8 -Append
#shell: pwsh
- name: debug - echo
run: echo "${{ steps.innoout.outputs.installername }}"
- name: Upload a Build Artifact
if: ${{ failure() }}
uses: actions/[email protected]
with:
name: build_output
path: ${{github.workspace}}/out
- name: Collect dev build
if: ${{ failure() }}
run: |
mkdir ${{github.workspace}}/zfs_collect
copy ${{github.workspace}}/out/build/x64-Debug/module/os/windows/driver/* ${{github.workspace}}/zfs_collect
copy ${{github.workspace}}/out/build/x64-Debug/cmd/os/windows/kstat/kstat.exe ${{github.workspace}}/zfs_collect/kstat.exe
copy ${{github.workspace}}/out/build/x64-Debug/cmd/os/windows/zfsinstaller/zfsinstaller.exe ${{github.workspace}}/zfs_collect/zfsinstaller.exe
copy ${{github.workspace}}/out/build/x64-Debug/cmd/zdb/zdb.exe ${{github.workspace}}/zfs_collect/zdb.exe
copy ${{github.workspace}}/out/build/x64-Debug/cmd/zfs/zfs.exe ${{github.workspace}}/zfs_collect/zfs.exe
copy ${{github.workspace}}/out/build/x64-Debug/cmd/zpool/zpool.exe ${{github.workspace}}/zfs_collect/zpool.exe
copy ${{github.workspace}}/out/build/x64-Debug/cmd/zstream/zstreamdump.exe ${{github.workspace}}/zfs_collect/zstreamdump.exe
- name: Upload dev build
if: ${{ failure() }}
uses: actions/[email protected]
with:
name: dev_build
path: ${{github.workspace}}/zfs_collect/*
- name: Upload dev build with Inno Setup
uses: actions/[email protected]
with:
name: dev_build_inno
path: ${{github.workspace}}\contrib\windows\${{ steps.innoout.outputs.name }}
# https://github.com/MicrosoftDocs/windows-powershell-docs/issues/266
- name: Import root certificate
run: |
$plaintextpwd = 'password1234'
$pwd = ConvertTo-SecureString -String $plaintextpwd -Force -AsPlainText
Import-PfxCertificate -FilePath ${{github.workspace}}/contrib/windows/TestCert/test_sign_cert_pass.pfx -CertStoreLocation Cert:\LocalMachine\Root -Password $pwd
Import-PfxCertificate -FilePath ${{github.workspace}}/contrib/windows/TestCert/test_sign_cert_pass.pfx -CertStoreLocation Cert:\LocalMachine\TrustedPublisher -Password $pwd
- name: install zfs
run: 'Start-Process -FilePath "${{github.workspace}}\contrib\windows\${{ steps.innoout.outputs.installername }}" -Wait -ArgumentList "/NORESTART /ALLUSERS /VERYSILENT /LOG=`"${{github.workspace}}\InnoSetup-Install.log`""'
#- name: Wait for install to finish
# run: Start-Sleep -Seconds 30
# uses: iFaxity/wait-on-action@v1
# with:
# resource: 'C:\Program Files\OpenZFS On Windows\zpool.exe'
- name: debug - print log
run: cat "${{github.workspace}}\InnoSetup-Install.log"
# This is a basic workflow to help you get started with Actions
# https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/
test1_tests:
needs: [build_windows] #, build_wsl]
timeout-minutes: 30
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: dev_build_inno
# - uses: actions/download-artifact@v3
# with:
# name: build result
# - name: get files
# run: Get-ChildItem -Recurse
- name: get diskdrive
run: wmic diskdrive list
# - name: Download
# uses: suisei-cn/[email protected]
# #id: innoinstaller
# with:
# url: 'https://github.com/andrewc12/zfsfiledump/raw/main/testdrives.zip'
# target: ${{github.workspace}}/
#
#
# - name: make disk
# run: |
# Expand-Archive -LiteralPath ${{github.workspace}}/testdrives.zip -DestinationPath D:\
#
# - name: Download
# uses: suisei-cn/[email protected]
# #id: innoinstaller
# with:
# url: 'https://github.com/andrewc12/zfsfiledump/raw/main/scriptname.txt'
# target: ${{github.workspace}}/
#
# - name: make disk
# run: |
# diskpart /s scriptname.txt
#
#
#
# - name: get diskdrive
# run: wmic diskdrive list
#
#
# - name: get files
# run: Get-ChildItem -Recurse
- name: get zfsexename
id: zfsinstaller
run: |
$p = Get-ChildItem | Where-Object {$_.Name -like 'OpenZFSOnWindows-*.exe'} | Select-Object -first 1
echo $p
$f = (Get-Item $p ).Name
echo $f
echo zfsinstallerfilename=$f
echo "zfsinstallerfilename=$f" | Out-File -FilePath $Env:GITHUB_OUTPUT -Encoding utf8 -Append
# https://github.com/MicrosoftDocs/windows-powershell-docs/issues/266
- name: Import root certificate
run: |
$plaintextpwd = 'password1234'
$pwd = ConvertTo-SecureString -String $plaintextpwd -Force -AsPlainText
Import-PfxCertificate -FilePath ${{github.workspace}}/contrib/windows/TestCert/test_sign_cert_pass.pfx -CertStoreLocation Cert:\LocalMachine\Root -Password $pwd
Import-PfxCertificate -FilePath ${{github.workspace}}/contrib/windows/TestCert/test_sign_cert_pass.pfx -CertStoreLocation Cert:\LocalMachine\TrustedPublisher -Password $pwd
- name: debug - echo filename
run: echo "${{ steps.zfsinstaller.outputs.zfsinstallerfilename }}"
# - name: debug - list
# run: ls ${{github.workspace}}\
- name: debug - list
run: ls ${{github.workspace}}\${{ steps.zfsinstaller.outputs.filename }}
#- name: install zfs
# run: ${{github.workspace}}\${{ steps.zfsinstaller.outputs.filename }} /NORESTART /ALLUSERS /VERYSILENT /LOG="${{github.workspace}}\InnoSetup-Install.log"
- name: install zfs
run: 'Start-Process -FilePath "${{github.workspace}}\${{ steps.zfsinstaller.outputs.zfsinstallerfilename }}" -Wait -ArgumentList "/NORESTART /ALLUSERS /VERYSILENT /LOG=`"${{github.workspace}}\InnoSetup-Install.log`""'
#- name: Wait for install to finish
# run: Start-Sleep -Seconds 30
# uses: iFaxity/wait-on-action@v1
# with:
# resource: 'C:\Program Files\OpenZFS On Windows\zpool.exe'
# - name: debug - print log
# run: cat "${{github.workspace}}\InnoSetup-Install.log"
#
# - name: debug - list
# run: ls "C:\Program Files"
#
# - name: debug - list
# run: ls "C:\Program Files\OpenZFS On Windows"
- name: debug - get status
run: '& "C:\Program Files\OpenZFS On Windows\zpool.exe" status'
- name: Create backing files
run: |
$f = new-object System.IO.FileStream ${{github.workspace}}\test01.dat, Create, ReadWrite
$f.SetLength(1GB)
$f.Close()
$f = new-object System.IO.FileStream ${{github.workspace}}\test02.dat, Create, ReadWrite
$f.SetLength(1GB)
$f.Close()
$f = new-object System.IO.FileStream ${{github.workspace}}\test03.dat, Create, ReadWrite
$f.SetLength(1GB)
$f.Close()
# - run: choco install gsudo
- name: tests/functional/cli_root/zpool_create/zpool_create_001_pos
timeout-minutes: 1
run: '& "C:\Program Files\OpenZFS On Windows\zpool.exe" create -f test01 \\?\${{github.workspace}}\test01.dat'
- run: Start-Sleep -Seconds 10
timeout-minutes: 1
- run: '& "C:\Program Files\OpenZFS On Windows\zpool.exe" status'
timeout-minutes: 1
- run: Start-Sleep -Seconds 10
timeout-minutes: 1
- run: '& "C:\Program Files\OpenZFS On Windows\zpool.exe" destroy -f test01'
timeout-minutes: 1
- run: Start-Sleep -Seconds 10
timeout-minutes: 1
- run: '& "C:\Program Files\OpenZFS On Windows\zpool.exe" create -f test02 \\?\${{github.workspace}}\test01.dat \\?\${{github.workspace}}\test02.dat'
timeout-minutes: 1
- run: Start-Sleep -Seconds 10
timeout-minutes: 1
- run: '& "C:\Program Files\OpenZFS On Windows\zpool.exe" destroy -f test02'
timeout-minutes: 1
- run: Start-Sleep -Seconds 10
timeout-minutes: 1
- run: '& "C:\Program Files\OpenZFS On Windows\zpool.exe" create -f test03 \\?\${{github.workspace}}\test01.dat \\?\${{github.workspace}}\test02.dat \\?\${{github.workspace}}\test03.dat'
timeout-minutes: 1
- run: Start-Sleep -Seconds 10
timeout-minutes: 1
- run: '& "C:\Program Files\OpenZFS On Windows\zpool.exe" destroy -f test03'
timeout-minutes: 1
- run: Start-Sleep -Seconds 10
timeout-minutes: 1
- run: '& "C:\Program Files\OpenZFS On Windows\zpool.exe" create -f test04 mirror \\?\${{github.workspace}}\test01.dat \\?\${{github.workspace}}\test02.dat'
timeout-minutes: 1
- run: Start-Sleep -Seconds 10
timeout-minutes: 1
- run: '& "C:\Program Files\OpenZFS On Windows\zpool.exe" destroy -f test04'
timeout-minutes: 1
- run: Start-Sleep -Seconds 10
timeout-minutes: 1
- run: '& "C:\Program Files\OpenZFS On Windows\zpool.exe" create -f test05 mirror \\?\${{github.workspace}}\test01.dat \\?\${{github.workspace}}\test02.dat \\?\${{github.workspace}}\test03.dat'
timeout-minutes: 1
- run: Start-Sleep -Seconds 10
timeout-minutes: 1
- run: '& "C:\Program Files\OpenZFS On Windows\zpool.exe" destroy -f test05'
timeout-minutes: 1
- run: Start-Sleep -Seconds 10
timeout-minutes: 1
- run: '& "C:\Program Files\OpenZFS On Windows\zpool.exe" create -f test06 raidz \\?\${{github.workspace}}\test01.dat \\?\${{github.workspace}}\test02.dat \\?\${{github.workspace}}\test03.dat'
timeout-minutes: 1
- run: Start-Sleep -Seconds 10
timeout-minutes: 1
- run: '& "C:\Program Files\OpenZFS On Windows\zpool.exe" destroy -f test06'
timeout-minutes: 1
- run: Start-Sleep -Seconds 10
timeout-minutes: 1
- run: '& "C:\Program Files\OpenZFS On Windows\zpool.exe" create -f test07 raidz1 \\?\${{github.workspace}}\test01.dat \\?\${{github.workspace}}\test02.dat \\?\${{github.workspace}}\test03.dat'
timeout-minutes: 1
- run: Start-Sleep -Seconds 10
timeout-minutes: 1
- run: '& "C:\Program Files\OpenZFS On Windows\zpool.exe" destroy -f test07'
timeout-minutes: 1
- run: Start-Sleep -Seconds 10
timeout-minutes: 1
- name: uninstall zfs
run: 'Start-Process -FilePath "C:\Program Files\OpenZFS On Windows\unins000.exe" -Wait -ArgumentList "/NORESTART /VERYSILENT /LOG=`"${{github.workspace}}\InnoSetup-Uninstall.log`""'
- name: debug - print log
run: cat "${{github.workspace}}\InnoSetup-Uninstall.log"
# This is a basic workflow to help you get started with Actions
# https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/
test2_winbtrfs:
needs: [build_windows] #, build_wsl]
timeout-minutes: 30
runs-on: windows-latest
# if: ${{ inputs.run-failing }}
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: dev_build_inno
# - uses: actions/download-artifact@v3
# with:
# name: build result
# - name: get files
# run: Get-ChildItem -Recurse
- name: get diskdrive
run: wmic diskdrive list
# - name: Download
# uses: suisei-cn/[email protected]
# #id: innoinstaller
# with:
# url: 'https://github.com/andrewc12/zfsfiledump/raw/main/testdrives.zip'
# target: ${{github.workspace}}/
#
#
# - name: make disk
# run: |
# Expand-Archive -LiteralPath ${{github.workspace}}/testdrives.zip -DestinationPath D:\
#
# - name: Download
# uses: suisei-cn/[email protected]
# #id: innoinstaller
# with:
# url: 'https://github.com/andrewc12/zfsfiledump/raw/main/scriptname.txt'
# target: ${{github.workspace}}/
#
# - name: make disk
# run: |
# diskpart /s scriptname.txt
#
#
#
# - name: get diskdrive
# run: wmic diskdrive list
#
#
# - name: get files
# run: Get-ChildItem -Recurse
- name: get zfsexename
id: zfsinstaller
run: |
$p = Get-ChildItem | Where-Object {$_.Name -like 'OpenZFSOnWindows-*.exe'} | Select-Object -first 1
echo $p
$f = (Get-Item $p ).Name
echo $f
echo "filename=$f" | Out-File -FilePath $Env:GITHUB_OUTPUT -Encoding utf8 -Append
# https://github.com/MicrosoftDocs/windows-powershell-docs/issues/266
- name: Import root certificate
run: |
$plaintextpwd = 'password1234'
$pwd = ConvertTo-SecureString -String $plaintextpwd -Force -AsPlainText
Import-PfxCertificate -FilePath ${{github.workspace}}/contrib/windows/TestCert/test_sign_cert_pass.pfx -CertStoreLocation Cert:\LocalMachine\Root -Password $pwd
Import-PfxCertificate -FilePath ${{github.workspace}}/contrib/windows/TestCert/test_sign_cert_pass.pfx -CertStoreLocation Cert:\LocalMachine\TrustedPublisher -Password $pwd
- name: debug - echo filename
run: echo ${{ steps.zfsinstaller.outputs.filename }}
# - name: debug - list
# run: ls ${{github.workspace}}\
- name: debug - list
run: ls ${{github.workspace}}\${{ steps.zfsinstaller.outputs.filename }}
#- name: install zfs
# run: ${{github.workspace}}\${{ steps.zfsinstaller.outputs.filename }} /NORESTART /ALLUSERS /VERYSILENT /LOG="${{github.workspace}}\InnoSetup-Install.log"
- name: install zfs
run: 'Start-Process -FilePath "${{github.workspace}}\${{ steps.zfsinstaller.outputs.filename }}" -Wait -ArgumentList "/NORESTART /ALLUSERS /VERYSILENT /LOG=`"${{github.workspace}}\InnoSetup-Install.log`""'
#- name: Wait for install to finish
# run: Start-Sleep -Seconds 30
# uses: iFaxity/wait-on-action@v1
# with:
# resource: 'C:\Program Files\OpenZFS On Windows\zpool.exe'
# - name: debug - print log
# run: cat "${{github.workspace}}\InnoSetup-Install.log"
#
# - name: debug - list
# run: ls "C:\Program Files"
#
# - name: debug - list
# run: ls "C:\Program Files\OpenZFS On Windows"
- name: debug - get status
run: '& "C:\Program Files\OpenZFS On Windows\zpool.exe" status'
- name: Create backing files
run: |
$f = new-object System.IO.FileStream ${{github.workspace}}\test01.dat, Create, ReadWrite
$f.SetLength(1GB)
$f.Close()
- name: create pool
run: '& "C:\Program Files\OpenZFS On Windows\zpool.exe" create tank \\?\${{github.workspace}}\test01.dat'
- name: get pool status
run: '& "C:\Program Files\OpenZFS On Windows\zpool.exe" status'
- name: get pool mount
run: '& "C:\Program Files\OpenZFS On Windows\zfs.exe" mount'
- name: get pool mount
id: drive # Remember to give an ID if you need the output filename
run: '& "C:\Program Files\OpenZFS On Windows\zfs.exe" mount | Select-String -Pattern "^tank +([A-Za-z]):[/\\]" | % {"drive=$($_.matches.groups[1].value):\"} | Out-File -FilePath $Env:GITHUB_OUTPUT -Encoding utf8 -Append'
- name: echo
run: echo ${{ steps.drive.outputs.drive }}
- name: Download winbtrfs
uses: suisei-cn/[email protected]
id: winbtrs # Remember to give an ID if you need the output filename
with:
url: "https://github.com/andrewc12/btrfs/releases/download/v1.8/x64-Debug.zip"
target: ${{github.workspace}}/
- name: extract
run: Expand-Archive -LiteralPath '${{ steps.winbtrs.outputs.filename }}' -DestinationPath ${{github.workspace}}\winbtrfs
- name: debug - list
run: ls ${{github.workspace}}\
- name: debug - list
run: ls ${{github.workspace}}\winbtrfs
#- name: run winbtrfs tests
# run: '& "${{github.workspace}}\winbtrfs\test.exe" ${{ steps.drive.outputs.drive }}'
- name: test dummy status step
id: dummy
run: exit 0
- name: debug - dummy status
run: echo ${{ steps.dummy.conclusion }}
- run: Start-Sleep -Seconds 10
timeout-minutes: 1
#https://github.com/maharmstone/btrfs/blob/master/src/tests/test.cpp#L453
- name: run winbtrfs create tests
if: ${{ ( success() || failure() ) && steps.dummy.conclusion == 'success' }}
timeout-minutes: 1
run: '& "${{github.workspace}}\winbtrfs\test.exe" create ${{ steps.drive.outputs.drive }}'
- run: Start-Sleep -Seconds 10
timeout-minutes: 1
- name: run winbtrfs supersede tests
if: ${{ ( success() || failure() ) && steps.dummy.conclusion == 'success' }}
timeout-minutes: 1
run: '& "${{github.workspace}}\winbtrfs\test.exe" supersede ${{ steps.drive.outputs.drive }}'
- run: Start-Sleep -Seconds 10
timeout-minutes: 1
- name: run winbtrfs overwrite tests
if: ${{ ( success() || failure() ) && steps.dummy.conclusion == 'success' }}
timeout-minutes: 1
run: '& "${{github.workspace}}\winbtrfs\test.exe" overwrite ${{ steps.drive.outputs.drive }}'
- run: Start-Sleep -Seconds 10
timeout-minutes: 1
- name: run winbtrfs open_id tests
if: ${{ ( success() || failure() ) && steps.dummy.conclusion == 'success' }}
timeout-minutes: 1
run: '& "${{github.workspace}}\winbtrfs\test.exe" open_id ${{ steps.drive.outputs.drive }}'
- run: Start-Sleep -Seconds 10
timeout-minutes: 1
- name: run winbtrfs io tests
if: ${{ ( success() || failure() ) && steps.dummy.conclusion == 'success' }}
timeout-minutes: 1
run: '& "${{github.workspace}}\winbtrfs\test.exe" io ${{ steps.drive.outputs.drive }}'
- run: Start-Sleep -Seconds 10
timeout-minutes: 1
- name: run winbtrfs mmap tests
if: ${{ ( success() || failure() ) && steps.dummy.conclusion == 'success' }}
timeout-minutes: 1
run: '& "${{github.workspace}}\winbtrfs\test.exe" mmap ${{ steps.drive.outputs.drive }}'
- run: Start-Sleep -Seconds 10
timeout-minutes: 1
- name: run winbtrfs rename tests
if: ${{ ( success() || failure() ) && steps.dummy.conclusion == 'success' }}
timeout-minutes: 1
run: '& "${{github.workspace}}\winbtrfs\test.exe" rename ${{ steps.drive.outputs.drive }}'
- run: Start-Sleep -Seconds 10
timeout-minutes: 1
- name: run winbtrfs rename_ex tests
if: ${{ ( success() || failure() ) && steps.dummy.conclusion == 'success' }}
timeout-minutes: 1
run: '& "${{github.workspace}}\winbtrfs\test.exe" rename_ex ${{ steps.drive.outputs.drive }}'
- run: Start-Sleep -Seconds 10
timeout-minutes: 1
- name: run winbtrfs delete tests
if: ${{ ( success() || failure() ) && steps.dummy.conclusion == 'success' }}
timeout-minutes: 1
run: '& "${{github.workspace}}\winbtrfs\test.exe" delete ${{ steps.drive.outputs.drive }}'
- run: Start-Sleep -Seconds 10
timeout-minutes: 1
- name: run winbtrfs delete_ex tests
if: ${{ ( success() || failure() ) && steps.dummy.conclusion == 'success' }}
timeout-minutes: 1
run: '& "${{github.workspace}}\winbtrfs\test.exe" delete_ex ${{ steps.drive.outputs.drive }}'
- run: Start-Sleep -Seconds 10
timeout-minutes: 1
- name: run winbtrfs links tests
if: ${{ ( success() || failure() ) && steps.dummy.conclusion == 'success' }}
timeout-minutes: 1
run: '& "${{github.workspace}}\winbtrfs\test.exe" links ${{ steps.drive.outputs.drive }}'
- run: Start-Sleep -Seconds 10
timeout-minutes: 1
- name: run winbtrfs links_ex tests
if: ${{ ( success() || failure() ) && steps.dummy.conclusion == 'success' }}
timeout-minutes: 1
run: '& "${{github.workspace}}\winbtrfs\test.exe" links_ex ${{ steps.drive.outputs.drive }}'
- run: Start-Sleep -Seconds 10
timeout-minutes: 1
- name: run winbtrfs oplock_i tests
if: ${{ ( success() || failure() ) && steps.dummy.conclusion == 'success' }}
timeout-minutes: 1
run: '& "${{github.workspace}}\winbtrfs\test.exe" oplock_i ${{ steps.drive.outputs.drive }}'
- run: Start-Sleep -Seconds 10
timeout-minutes: 1
- name: run winbtrfs oplock_ii tests
if: ${{ ( success() || failure() ) && steps.dummy.conclusion == 'success' }}
timeout-minutes: 1
run: '& "${{github.workspace}}\winbtrfs\test.exe" oplock_ii ${{ steps.drive.outputs.drive }}'
- run: Start-Sleep -Seconds 10
timeout-minutes: 1
- name: run winbtrfs oplock_batch tests
if: ${{ ( success() || failure() ) && steps.dummy.conclusion == 'success' }}
timeout-minutes: 1
run: '& "${{github.workspace}}\winbtrfs\test.exe" oplock_batch ${{ steps.drive.outputs.drive }}'
- run: Start-Sleep -Seconds 10
timeout-minutes: 1
- name: run winbtrfs oplock_filter tests
if: ${{ ( success() || failure() ) && steps.dummy.conclusion == 'success' }}
timeout-minutes: 1
run: '& "${{github.workspace}}\winbtrfs\test.exe" oplock_filter ${{ steps.drive.outputs.drive }}'
- run: Start-Sleep -Seconds 10
timeout-minutes: 1
- name: run winbtrfs oplock_r tests
if: ${{ ( success() || failure() ) && steps.dummy.conclusion == 'success' }}
timeout-minutes: 1
run: '& "${{github.workspace}}\winbtrfs\test.exe" oplock_r ${{ steps.drive.outputs.drive }}'
- run: Start-Sleep -Seconds 10
timeout-minutes: 1
- name: run winbtrfs oplock_rw tests
if: ${{ ( success() || failure() ) && steps.dummy.conclusion == 'success' }}
timeout-minutes: 1
run: '& "${{github.workspace}}\winbtrfs\test.exe" oplock_rw ${{ steps.drive.outputs.drive }}'
- run: Start-Sleep -Seconds 10
timeout-minutes: 1
- name: run winbtrfs oplock_rh tests
if: ${{ ( success() || failure() ) && steps.dummy.conclusion == 'success' }}
timeout-minutes: 1
run: '& "${{github.workspace}}\winbtrfs\test.exe" oplock_rh ${{ steps.drive.outputs.drive }}'
- run: Start-Sleep -Seconds 10
timeout-minutes: 1
- name: run winbtrfs oplock_rwh tests
if: ${{ ( success() || failure() ) && steps.dummy.conclusion == 'success' }}
timeout-minutes: 1
run: '& "${{github.workspace}}\winbtrfs\test.exe" oplock_rwh ${{ steps.drive.outputs.drive }}'
- run: Start-Sleep -Seconds 10
timeout-minutes: 1
- name: run winbtrfs cs tests
if: ${{ ( success() || failure() ) && steps.dummy.conclusion == 'success' }}
timeout-minutes: 1
run: '& "${{github.workspace}}\winbtrfs\test.exe" cs ${{ steps.drive.outputs.drive }}'
- run: Start-Sleep -Seconds 10
timeout-minutes: 1
- name: run winbtrfs reparse tests
if: ${{ ( success() || failure() ) && steps.dummy.conclusion == 'success' }}
timeout-minutes: 1
run: '& "${{github.workspace}}\winbtrfs\test.exe" reparse ${{ steps.drive.outputs.drive }}'
- run: Start-Sleep -Seconds 10
timeout-minutes: 1
- name: run winbtrfs streams tests
if: ${{ ( success() || failure() ) && steps.dummy.conclusion == 'success' }}
timeout-minutes: 1
run: '& "${{github.workspace}}\winbtrfs\test.exe" streams ${{ steps.drive.outputs.drive }}'
- run: Start-Sleep -Seconds 10
timeout-minutes: 1
#- name: run winbtrfs ea tests
# if: ${{ ( success() || failure() ) && steps.dummy.conclusion == 'success' }}
# run: '& "${{github.workspace}}\winbtrfs\test.exe" ea ${{ steps.drive.outputs.drive }}'
- name: run winbtrfs fileinfo tests
if: ${{ ( success() || failure() ) && steps.dummy.conclusion == 'success' }}
timeout-minutes: 1
run: '& "${{github.workspace}}\winbtrfs\test.exe" fileinfo ${{ steps.drive.outputs.drive }}'
- run: Start-Sleep -Seconds 10
timeout-minutes: 1
- name: run winbtrfs ea tests
if: ${{ ( success() || failure() ) && steps.dummy.conclusion == 'success' }}
timeout-minutes: 1
run: '& "${{github.workspace}}\winbtrfs\test.exe" ea ${{ steps.drive.outputs.drive }}'
#- name: run export zpool
# if: ${{ always() }}
# timeout-minutes: 1
# run: '& "C:\Program Files\OpenZFS On Windows\zpool.exe" export tank'
# This is a basic workflow to help you get started with Actions
# https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/
# test3:
# needs: [build_windows, build_wsl]
# runs-on: windows-latest
# steps:
#
# - uses: actions/checkout@v3
#
#
# - uses: actions/download-artifact@v3
# with:
# name: dev_build_inno
#
## - uses: actions/download-artifact@v3
## with:
## name: build result
#
## - name: get files
## run: Get-ChildItem -Recurse
#
# - name: get diskdrive
# run: wmic diskdrive list
#
## - name: Download
## uses: suisei-cn/[email protected]
## #id: innoinstaller
## with:
## url: 'https://github.com/andrewc12/zfsfiledump/raw/main/testdrives.zip'
## target: ${{github.workspace}}/
##
##
## - name: make disk
## run: |
## Expand-Archive -LiteralPath ${{github.workspace}}/testdrives.zip -DestinationPath D:\
##
## - name: Download
## uses: suisei-cn/[email protected]
## #id: innoinstaller
## with:
## url: 'https://github.com/andrewc12/zfsfiledump/raw/main/scriptname.txt'
## target: ${{github.workspace}}/
##
## - name: make disk
## run: |
## diskpart /s scriptname.txt
##
##
##
## - name: get diskdrive
## run: wmic diskdrive list
##
##
## - name: get files
## run: Get-ChildItem -Recurse
#
#
# - name: get zfsexename
# id: zfsinstaller
# run: |
# $p = Get-ChildItem | Where-Object {$_.Name -like 'OpenZFSOnWindows-*.exe'} | Select-Object -first 1
# echo $p
# $f = (Get-Item $p ).Name
# echo $f
# echo "::set-output name=filename::$($f)"
#
# # https://github.com/MicrosoftDocs/windows-powershell-docs/issues/266
# - name: Import root certificate
# run: |
# $plaintextpwd = 'password1234'
# $pwd = ConvertTo-SecureString -String $plaintextpwd -Force -AsPlainText
# Import-PfxCertificate -FilePath ${{github.workspace}}/contrib/windows/TestCert/test_sign_cert_pass.pfx -CertStoreLocation Cert:\LocalMachine\Root -Password $pwd
# Import-PfxCertificate -FilePath ${{github.workspace}}/contrib/windows/TestCert/test_sign_cert_pass.pfx -CertStoreLocation Cert:\LocalMachine\TrustedPublisher -Password $pwd
#
# - name: debug - echo filename
# run: echo ${{ steps.zfsinstaller.outputs.filename }}
#
## - name: debug - list
## run: ls ${{github.workspace}}\
#
# - name: debug - list
# run: ls ${{github.workspace}}\${{ steps.zfsinstaller.outputs.filename }}
#
# #- name: install zfs
# # run: ${{github.workspace}}\${{ steps.zfsinstaller.outputs.filename }} /NORESTART /ALLUSERS /VERYSILENT /LOG="${{github.workspace}}\InnoSetup-Install.log"
#
# - name: install zfs
# run: 'Start-Process -FilePath "${{github.workspace}}\${{ steps.zfsinstaller.outputs.filename }}" -Wait -ArgumentList "/NORESTART /ALLUSERS /VERYSILENT /LOG=`"${{github.workspace}}\InnoSetup-Install.log`""'
#
# #- name: Wait for install to finish
# # run: Start-Sleep -Seconds 30
# # uses: iFaxity/wait-on-action@v1
# # with:
# # resource: 'C:\Program Files\OpenZFS On Windows\zpool.exe'
#
## - name: debug - print log
## run: cat "${{github.workspace}}\InnoSetup-Install.log"
##
## - name: debug - list
## run: ls "C:\Program Files"
##
## - name: debug - list
## run: ls "C:\Program Files\OpenZFS On Windows"
#
# - name: debug - get status
# run: '& "C:\Program Files\OpenZFS On Windows\zpool.exe" status'
#
#
#
#
#
#
#
# - name: Create backing files
# run: |
# $f = new-object System.IO.FileStream ${{github.workspace}}\test01.dat, Create, ReadWrite
# $f.SetLength(1GB)
# $f.Close()
# $f = new-object System.IO.FileStream ${{github.workspace}}\test02.dat, Create, ReadWrite
# $f.SetLength(1GB)
# $f.Close()
# $f = new-object System.IO.FileStream ${{github.workspace}}\test03.dat, Create, ReadWrite
# $f.SetLength(1GB)
# $f.Close()
#
## - run: choco install gsudo
#
# - name: tests/functional/cli_root/zpool_create/zpool_create_001_pos
# run: '& "C:\Program Files\OpenZFS On Windows\zpool.exe" create -f test01 \\?\${{github.workspace}}\test01.dat'
# - run: Start-Sleep -Seconds 10
#
# - run: '& "C:\Program Files\OpenZFS On Windows\zpool.exe" status'