zbox 0.9.2

ZboxFS is a zero-details, privacy-focused in-app file system.
Documentation
name: build

on: [push]

env:
  LIBSODIUM: libsodium-1.0.18

jobs:
  build-linux:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v1

    - name: Cache libsodium
      id: cache-libsodium
      uses: actions/cache@v1
      with:
        path: libsodium-1.0.18
        key: ${{ runner.os }}-libsodium-1.0.18

    - name: Build libsodium
      if: steps.cache-libsodium.outputs.cache-hit != 'true'
      run: |
        wget -nv https://download.libsodium.org/libsodium/releases/$LIBSODIUM.tar.gz
        tar -xzf $LIBSODIUM.tar.gz
        cd $LIBSODIUM && ./configure --prefix=/usr && make

    - name: Install libsodium
      run: cd $LIBSODIUM && sudo make install

    - name: Build ZboxFS
      run: cargo build

    - name: Run ZboxFS tests
      run: cargo test

    - name: Run ZboxFS file storage tests
      run: cargo test --features storage-file

  build-win:
    runs-on: windows-latest
    env:
      SODIUM_LIB_DIR: libsodium-1.0.18\x64\Release\v141\static
      SODIUM_STATIC: 1

    steps:
    - uses: actions/checkout@v1

    - name: Cache libsodium
      id: cache-libsodium
      uses: actions/cache@v1
      with:
        path: libsodium-1.0.18
        key: ${{ runner.os }}-libsodium-1.0.18

    - name: Download libsodium
      if: steps.cache-libsodium.outputs.cache-hit != 'true'
      run: |
        Invoke-WebRequest https://download.libsodium.org/libsodium/releases/${env:LIBSODIUM}-msvc.zip -OutFile ${env:LIBSODIUM}-msvc.zip
        Expand-Archive ${env:LIBSODIUM}-msvc.zip -DestinationPath ${env:LIBSODIUM}

    - name: Build ZboxFS
      run: cargo build

    - name: Run ZboxFS tests
      run: cargo test

    - name: Run ZboxFS file storage tests
      run: cargo test --features storage-file