Skip to content

Commit

Permalink
Add build and test for Windows in CI (#8)
Browse files Browse the repository at this point in the history
* Add release (#1)

* add release.yaml to help release

* change the action name

* delete trigger branch limit

* add branch limit

* Add release (#2)

* add release.yaml to help release

* change the action name

* delete trigger branch limit

* add branch limit

* add needs

* fix some bugs

* add wheel to requirements-dev.txt

* fix wrong command

* move publish to a single job

* delete wrong command

* change upload mistake

* fix wrong macos platform tag

* add win build and test action

* fix syntax error

* enable download artifact on windows

* Add win compatibility (#3)

* juicefs can format and init on Windows

* Wrap os.path.join() with Path().as_posix() to support Windows. jfs.concat() remains problematic on Windows

* format the files

* add win build and test action

* fix syntax error

* enable download artifact on windows

* add windows build and test to on-push.yaml

* change the build win binary if statements

* remove win_build_test.yaml. It's merged into on-push.yaml
  • Loading branch information
HugoAhoy committed Aug 30, 2021
1 parent c07f0ab commit 10d7fb7
Showing 1 changed file with 40 additions and 5 deletions.
45 changes: 40 additions & 5 deletions .github/workflows/on-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,32 @@ jobs:
./juicefs/lib/libjfs.so
./juicefs/lib/juicefs
key: ${{ matrix.os }}-jfs-binary-${{ steps.jfs-version.outputs.JUICEFS_VERSION }}
- name: Cache juicefs and libjfs binary windows
if: ${{ matrix.os == 'ubuntu-18.04' }}
uses: actions/cache@v2
id: jfs-cache-win
with:
path: |
./juicefs/lib/libjfs.dll
./juicefs/lib/juicefs.exe
key: ${{ matrix.os }}-jfs-binary-win-${{ steps.jfs-version.outputs.JUICEFS_VERSION }}

- name: Run build-libjfs linux/mac
if: ${{ steps.jfs-cache.outputs.cache-hit != 'true' }}
run: |
make build_libjfs_so
- name: Install MinGW GCC
if: ${{ steps.jfs-cache-win.outputs.cache-hit != 'true' && matrix.os == 'ubuntu-18.04'}}
run: |
sudo apt-get update
sudo apt-get install gcc-mingw-w64-x86-64
- name: Run build-libjfs windows
if: ${{ steps.jfs-cache-win.outputs.cache-hit != 'true' && matrix.os == 'ubuntu-18.04'}}
run: |
make build_libjfs_dll
- name: Upload linux jfs binary
if: matrix.os == 'ubuntu-18.04'
uses: actions/upload-artifact@v2
Expand All @@ -51,23 +71,33 @@ jobs:
./juicefs/lib/libjfs.so
./juicefs/lib/juicefs
retention-days: 1
- name: Upload windows jfs binary
if: matrix.os == 'ubuntu-18.04'
uses: actions/upload-artifact@v2
with:
name: jfs-binary-win-${{ steps.jfs-version.outputs.JUICEFS_VERSION }}
path: |
./juicefs/lib/libjfs.dll
./juicefs/lib/juicefs.exe
retention-days: 1

build-and-tests:
needs: build-juicefs-libjfs
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-18.04]
os: [macos-latest, ubuntu-18.04, windows-latest]
python-version: [3.6, 3.7, 3.8, 3.9]
include:
- os: ubuntu-18.04
os-key: linux
pip-path: /opt/hostedtoolcache/Python
libjfs-path: /opt/hostedtoolcache/Golang
- os: macos-latest
os-key: mac
pip-path: /Users/runner/hostedtoolcache/Python
libjfs-path: /Users/runner/hostedtoolcache/Golang
- os: windows-latest
os-key: win
pip-path: C:\hostedtoolcache\windows\Python

steps:
- name: Checkout Github Repository
Expand All @@ -91,8 +121,7 @@ jobs:
- name: Get JuiceFS Version
id: jfs-version
run: echo "::set-output name=JUICEFS_VERSION::$(make -s print_libjfs_version)"
- name: Download jfs binary artifact Linux/Mac
if: ${{ matrix.os != 'windows-latest' }}
- name: Download jfs binary artifact Linux/Mac/Windows
uses: actions/download-artifact@v2
with:
name: jfs-binary-${{ matrix.os-key }}-${{ steps.jfs-version.outputs.JUICEFS_VERSION }}
Expand All @@ -103,6 +132,12 @@ jobs:
chmod 755 ./juicefs/lib/juicefs
ls -l ./juicefs/lib/juicefs
- name: Chmod to make juicefs executable windows
if: ${{ matrix.os == 'windows-latest' }}
run: |
chmod 755 ./juicefs/lib/juicefs.exe
ls -l ./juicefs/lib/juicefs.exe
- name: Run style-check
if: ${{ matrix.python-version == '3.6' && matrix.os != 'windows-latest' }}
run: |
Expand Down

0 comments on commit 10d7fb7

Please sign in to comment.