|
|
|
name: Build and test api
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ main, develop, gh-actions ]
|
|
|
|
pull_request:
|
|
|
|
branches: [ main, develop ]
|
|
|
|
|
|
|
|
env:
|
|
|
|
CARGO_TERM_COLOR: always
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
|
|
|
build:
|
|
|
|
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: bash
|
|
|
|
working-directory: mediarepo-api
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
if: ${{ !env.ACT }}
|
|
|
|
|
|
|
|
- name: Cache build data
|
|
|
|
if: ${{ !env.ACT }}
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
target
|
|
|
|
~/.cargo/
|
|
|
|
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-cargo-
|
|
|
|
|
|
|
|
- name: Install OS-specific dependencies
|
|
|
|
uses: knicknic/os-specific-run@v1.0.3
|
|
|
|
with:
|
|
|
|
linux: |
|
|
|
|
sudo apt-get update
|
|
|
|
DEBIAN_FRONTEND=noninteractive sudo apt-get install libwebkit2gtk-4.0-dev libgtk-3-dev libappindicator3-dev -y
|
|
|
|
|
|
|
|
- name: Build
|
|
|
|
run: cargo build
|
|
|
|
|
|
|
|
- name: Build API
|
|
|
|
run: cargo build --features=client-api
|
|
|
|
|
|
|
|
- name: Build Plugin
|
|
|
|
run: cargo build --features=tauri-plugin
|
|
|
|
|
|
|
|
- name: Test
|
|
|
|
run: cargo test --all-features
|