Skip to content

Commit

Permalink
add windows support in ci
Browse files Browse the repository at this point in the history
  • Loading branch information
HugoAhoy committed Aug 25, 2021
1 parent 3115717 commit ff946ba
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 5 deletions.
29 changes: 24 additions & 5 deletions .github/workflows/on-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-18.04, macos-latest]
os: [ubuntu-18.04, macos-latest, windows-latest]
python-version: [3.6, 3.7, 3.8, 3.9]
include:
- os: ubuntu-18.04
Expand All @@ -17,6 +17,9 @@ jobs:
- os: macos-latest
pip-path: /Users/runner/hostedtoolcache/Python
libjfs-path: /Users/runner/hostedtoolcache/Golang
- os: windows-latest
pip-path: C:\hostedtoolcache\windows\Python
libjfs-path: C:\hostedtoolcache\windows\Golang

steps:
- name: Checkout Github Repository
Expand Down Expand Up @@ -49,22 +52,38 @@ jobs:
path: ${{ matrix.libjfs-path }}/libjfs
key: ${{ matrix.os }}-golang-libjfs${{ steps.jfs-version.outputs.JUICEFS_VERSION }}
- name: Run build-libjfs linux/mac
if: steps.libjfs-cache.outputs.cache-hit != 'true'
if: ${{ steps.libjfs-cache.outputs.cache-hit != 'true' && matrix.os != 'windows-latest' }}
run: |
make build_libjfs_so
mkdir -p ${{ matrix.libjfs-path }}/libjfs
mv juicefs/lib/juicefs ${{ matrix.libjfs-path }}/libjfs/juicefs
mv juicefs/lib/libjfs.so ${{ matrix.libjfs-path }}/libjfs/libjfs.so
- name: Link libjfs
- name: Run build-libjfs win
if: ${{ steps.libjfs-cache.outputs.cache-hit != 'true' && matrix.os == 'windows-latest' }}
run: |
make build_libjfs_dll
mkdir -p ${{ matrix.libjfs-path }}/libjfs
mv juicefs/lib/juicefs.exe ${{ matrix.libjfs-path }}/libjfs/juicefs.exe
mv juicefs/lib/libjfs.dll ${{ matrix.libjfs-path }}/libjfs/libjfs.dll
- name: Link libjfs linux/mac
if: ${{ matrix.os != 'windows-latest' }}
run: |
ln -s ${{ matrix.libjfs-path }}/libjfs/juicefs juicefs/lib/juicefs
ln -s ${{ matrix.libjfs-path }}/libjfs/libjfs.so juicefs/lib/libjfs.so
- name: Link libjfs win
if: ${{ matrix.os == 'windows-latest' }}
run: |
ln -s ${{ matrix.libjfs-path }}/libjfs/juicefs.exe juicefs/lib/juicefs.exe
ln -s ${{ matrix.libjfs-path }}/libjfs/libjfs.dll juicefs/lib/libjfs.dll
- name: Run style-check
if: matrix.python-version == '3.6'
if: ${{ matrix.python-version == '3.6' && matrix.os != 'windows-latest' }}
run: |
make style_check
- name: Run static-check
if: matrix.python-version == '3.6'
if: ${{ matrix.python-version == '3.6' && matrix.os != 'windows-latest' }}
run: |
make static_check
- name: Run unit-test
Expand Down
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@ build_libjfs_so:
&& make juicefs \
&& cp juicefs ../../juicefs/lib/juicefs

build_libjfs_dll:
rm -rf build && mkdir build
cd build \
&& curl -L -O https://github.com/juicedata/juicefs/archive/refs/tags/v${JUICEFS_VERSION}.zip \
&& unzip v${JUICEFS_VERSION}.zip
cd build/juicefs-${JUICEFS_VERSION}/sdk/java/libjfs \
&& make libjfs.dll \
&& cp libjfs.dll ../../../../../juicefs/lib/libjfs.dll
cd build/juicefs-${JUICEFS_VERSION} \
&& make juicefs.exe \
&& cp juicefs.exe ../../juicefs/lib/juicefs.exe

print_libjfs_version:
echo ${JUICEFS_VERSION}

Expand Down

0 comments on commit ff946ba

Please sign in to comment.