Skip to content

Commit

Permalink
CI: fix windows test (#5077)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhoucheng361 authored Aug 12, 2024
1 parent 97082f1 commit b6582db
Showing 1 changed file with 50 additions and 54 deletions.
104 changes: 50 additions & 54 deletions .github/workflows/wintest.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
name: "test jfs on windows"
name: "wintest"

on:
push:
branches:
- 'main'
- 'release-**'
paths-ignore:
- 'docs/**'
- '**.md'
paths:
- '**/wintest.yml'
pull_request:
#The branches below must be a subset of the branches above
branches:
- 'main'
- 'release-**'
paths-ignore:
- 'docs/**'
- '**.md'
paths:
- '**/wintest.yml'
workflow_dispatch:
schedule:
- cron: '0 0 * * 0'

jobs:
wintest:
Expand All @@ -25,34 +26,24 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 'oldstable'
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: Cache WinFsp
id: Cache-WinFsp
uses: actions/cache@v3
with:
path: 'C:\wfsp\'
key: ${{ runner.os }}-winfsp-key
restore-keys: |
${{ runner.os }}-winfsp
- name: Download WinFsp
if: steps.Cache-WinFsp.outputs.cache-hit != 'true'
run: |
choco install wget
mkdir "C:\wfsp\"
Expand All @@ -63,8 +54,6 @@ jobs:
run: |
msiexec.exe /i "C:\wfsp\winfsp.msi" /qn /norestart INSTALLLEVEL=1000
- name: Set up Include Headers
run: |
mkdir "C:\WinFsp\inc\fuse"
Expand All @@ -75,20 +64,26 @@ jobs:
go env -w CGO_CFLAGS=-IC:/WinFsp/inc/fuse
go env
- name: Install Scoop Redis and MinIO
- 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 curl
scoop install redis
scoop install minio@2021-12-10T23-03-39Z
scoop install runasti
curl https://repo.jenkins-ci.org/releases/com/sun/winsw/winsw/2.9.0/winsw-2.9.0-net4.exe -o redis-service.exe
- 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
Expand All @@ -98,7 +93,10 @@ jobs:
echo "</service>" >> redis-service.xml
.\redis-service.exe install
net start redisredis
curl https://repo.jenkins-ci.org/releases/com/sun/winsw/winsw/2.9.0/winsw-2.9.0-net4.exe -o minio-service.exe
- name: Start Minio
run: |
copy winsw.exe minio-service.exe
mkdir "C:\tmp"
echo "<service>" >> minio-service.xml
echo "<id>MinIO</id>" >> minio-service.xml
Expand All @@ -111,15 +109,6 @@ jobs:
.\minio-service.exe install
net start MinIO
- uses: actions/cache@v3
with:
path: |
~\AppData\Local\go-build
~\go\pkg\mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Build Juicefs
run: |
go build -ldflags="-s -w" -o juicefs.exe .
Expand All @@ -131,17 +120,25 @@ jobs:
- name: Juicefs Mount
run: |
echo "C:\Program Files (x86)\WinFsp\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
curl https://repo.jenkins-ci.org/releases/com/sun/winsw/winsw/2.9.0/winsw-2.9.0-net4.exe -o juicefs-service.exe
copy winsw.exe juicefs-service.exe
echo "<service>" >> juicefs-service.xml
echo "<id>jfs</id>" >> juicefs-service.xml
echo "<name>jfs</name>" >> juicefs-service.xml
echo "<description>jfs</description>" >> 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 jfs
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
Expand All @@ -151,18 +148,17 @@ jobs:
# 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
# - 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
Expand Down

0 comments on commit b6582db

Please sign in to comment.