wintest #1854
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "wintest" | |
on: | |
push: | |
branches: | |
- 'main' | |
- 'release-**' | |
paths: | |
- '**/wintest.yml' | |
pull_request: | |
branches: | |
- 'main' | |
- 'release-**' | |
paths: | |
- '**/wintest.yml' | |
workflow_dispatch: | |
schedule: | |
- cron: '0 17 * * 0' | |
jobs: | |
wintest: | |
runs-on: windows-2019 | |
env: | |
Actions_Allow_Unsecure_Commands: true | |
steps: | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: '1.21' | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
- name: Setup MSBuild.exe | |
if: false | |
uses: microsoft/[email protected] | |
- name: Change Winsdk Version | |
if: false | |
uses: GuillaumeFalourd/setup-windows10-sdk-action@v1 | |
with: | |
sdk-version: 18362 | |
- name: Download WinFsp | |
run: | | |
choco install wget | |
mkdir "C:\wfsp\" | |
wget -O winfsp.msi https://github.com/billziss-gh/winfsp/releases/download/v1.9/winfsp-1.9.21096.msi | |
copy winfsp.msi "C:\wfsp\" | |
- name: Install WinFsp | |
run: | | |
msiexec.exe /i "C:\wfsp\winfsp.msi" /qn /norestart INSTALLLEVEL=1000 | |
- name: Set up Include Headers | |
run: | | |
mkdir "C:\WinFsp\inc\fuse" | |
copy .\hack\winfsp_headers\* C:\WinFsp\inc\fuse\ | |
dir "C:\WinFsp\inc\fuse" | |
set CGO_CFLAGS=-IC:/WinFsp/inc/fuse | |
go env | |
go env -w CGO_CFLAGS=-IC:/WinFsp/inc/fuse | |
go env | |
- name: Install Scoop | |
run: | | |
dir "C:\Program Files (x86)\WinFsp" | |
Set-ExecutionPolicy RemoteSigned -scope CurrentUser | |
iwr -useb 'https://raw.githubusercontent.com/scoopinstaller/install/master/install.ps1' -outfile 'install.ps1' | |
.\install.ps1 -RunAsAdmin | |
echo $env:USERNAME | |
scoop | |
scoop install redis | |
scoop install minio@2021-12-10T23-03-39Z | |
scoop install runasti | |
- name: Download winsw | |
run: | | |
wget https://github.com/winsw/winsw/releases/download/v2.12.0/WinSW-x64.exe -O winsw.exe | |
ls winsw.exe | |
- name: Start Redis | |
run: | | |
copy winsw.exe redis-service.exe | |
echo "<service>" >> redis-service.xml | |
echo "<id>redisredis</id>" >> redis-service.xml | |
echo "<name>redisredis</name>" >> redis-service.xml | |
echo "<description>redisredis</description>" >> redis-service.xml | |
echo "<executable>C:\Users\$env:USERNAME\scoop\shims\redis-server.exe</executable>" >> redis-service.xml | |
echo "<logmode>rotate</logmode>" >> redis-service.xml | |
echo "</service>" >> redis-service.xml | |
.\redis-service.exe install | |
net start redisredis | |
- name: Build Juicefs | |
run: | | |
go build -ldflags="-s -w" -o juicefs.exe . | |
- name: Juicefs Format | |
run: | | |
./juicefs.exe format redis://127.0.0.1:6379/1 myjfs | |
- name: Juicefs Mount | |
run: | | |
echo "C:\Program Files (x86)\WinFsp\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
copy winsw.exe juicefs-service.exe | |
echo "<service>" >> juicefs-service.xml | |
echo "<id>juicefs</id>" >> juicefs-service.xml | |
echo "<name>juicefs</name>" >> juicefs-service.xml | |
echo "<description>juicefs</description>" >> juicefs-service.xml | |
echo "<executable>$PWD\juicefs.exe</executable>" >> juicefs-service.xml | |
echo "<arguments>mount redis://127.0.0.1:6379/1 Z: --no-usage-report</arguments>" >> juicefs-service.xml | |
echo "<logmode>rotate</logmode>" >> juicefs-service.xml | |
echo "</service>" >> juicefs-service.xml | |
.\juicefs-service.exe install | |
net start juicefs | |
- name: Test Juicefs | |
run: | | |
mkdir "Z:\dir" | |
dir "Z:\dir" | |
echo "hello" > "Z:\dir\hello.txt" | |
dir "Z:\dir\hello.txt" | |
type "Z:\dir\hello.txt" | |
#there is go-fuse compile error with unit test | |
#- name: Unit Test | |
# run: | | |
# rm pkg/meta/redis_test.go | |
# rm pkg/meta/sql_test.go | |
# rm pkg/meta/tkv_test.go | |
# go test -v -cover ./pkg/... ./cmd/... | |
# - name: Install Python2 | |
# run: | | |
# choco install python2 -y | |
# - name: Build and Run Winfstest | |
# run: | | |
# git clone https://github.com/sanwan/winfstest.git | |
# cd winfstest | |
# msbuild.exe winfstest.sln | |
# cd TestSuite | |
# .\run-winfstest | |
#cannot write file because of some permission question with winfsp | |
#- name: Build and Run Winfstest in Jfs Directory | |
# run: | | |
# Z: | |
# mkdir "Z:\tmptmp" | |
# cd tmptmp | |
# git clone https://github.com/sanwan/winfstest.git | |
# cd winfstest | |
# msbuild.exe winfstest.sln | |
# cd TestSuite | |
# .\run-winfstest |