Merge pull request #30 from wravery/dev #18
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Rust validation | |
on: | |
push: | |
branches: | |
- dev | |
pull_request: | |
branches: | |
- dev | |
jobs: | |
rust: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu-latest | |
- macos-latest | |
- windows-latest | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/[email protected] | |
- name: Check fmt | |
run: cargo fmt --check | |
- name: Install ninja | |
run: | | |
${{ matrix.os == 'macos-latest' && 'brew install ninja' | |
|| (matrix.os == 'windows-latest' && 'choco install ninja' | |
|| 'echo "ninja already installed"') }} | |
- name: Cache CEF | |
id: cache-cef | |
uses: actions/[email protected] | |
with: | |
path: ~/.local/share/cef | |
key: cef-${{ matrix.os }}-${{ hashFiles('Cargo.toml') }} | |
- name: ${{ steps.cache-cef.outputs.cache-hit && 'Use cache' || 'Export CEF' }} | |
run: | | |
${{ steps.cache-cef.outputs.cache-hit && 'echo "Cached CEF"' | |
|| (matrix.os == 'windows-latest' | |
&& 'cargo run -p export-cef-dir -- "$env:USERPROFILE/.local/share/cef"' | |
|| 'cargo run -p export-cef-dir -- "$HOME/.local/share/cef"') | |
}} | |
echo "CEF_PATH=${{ matrix.os == 'windows-latest' | |
&& '$env:USERPROFILE' | |
|| '$HOME' | |
}}/.local/share/cef" >> $${{ matrix.os == 'windows-latest' | |
&& 'env:' | |
|| '' | |
}}GITHUB_ENV | |
echo "${{ matrix.os == 'macos-latest' | |
&& 'DYLD_FALLBACK_LIBRARY_PATH' | |
|| (matrix.os == 'windows-latest' | |
&& 'PATH' | |
|| 'LD_LIBRARY_PATH') }}=${{ matrix.os == 'macos-latest' | |
&& '$DYLD_FALLBACK_LIBRARY_PATH:$HOME/.local/share/cef' | |
|| (matrix.os == 'windows-latest' | |
&& '$env:PATH;$env:USERPROFILE/.local/share/cef' | |
|| '$LD_LIBRARY_PATH:$HOME/.local/share/cef') }}" >> $${{ matrix.os == 'windows-latest' | |
&& 'env:' | |
|| '' | |
}}GITHUB_ENV | |
- name: Build | |
run: cargo build --verbose | |
- name: Run tests | |
run: cargo test --verbose |