mirror of
https://github.com/ethersync/ethersync.git
synced 2025-08-02 04:07:29 +03:00
84 lines
2.5 KiB
YAML
84 lines
2.5 KiB
YAML
# SPDX-FileCopyrightText: NONE
|
|
#
|
|
# SPDX-License-Identifier: CC0-1.0
|
|
|
|
name: General tests
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- 'main'
|
|
paths:
|
|
- 'daemon/**'
|
|
- 'nvim-plugin/**'
|
|
- '.github/workflows/general.yml'
|
|
pull_request:
|
|
paths:
|
|
- 'daemon/**'
|
|
- 'nvim-plugin/**'
|
|
- '.github/workflows/general.yml'
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
CARGO_PROFILE_TEST_DEBUG: 0 # See https://corrode.dev/blog/tips-for-faster-ci-builds/
|
|
|
|
defaults:
|
|
run:
|
|
working-directory: ./daemon
|
|
|
|
jobs:
|
|
build_and_test:
|
|
name: Run tests
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest]
|
|
nvim-version: [v0.9.5, v0.10.4, v0.11.2]
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Set up Rust toolchain
|
|
run: rustup toolchain install stable --profile minimal
|
|
- uses: Swatinem/rust-cache@v2
|
|
with:
|
|
workspaces: |
|
|
daemon
|
|
daemon/integration-tests
|
|
cache-on-failure: true
|
|
- name: Build Ethersync
|
|
run: cargo build --release
|
|
- name: Add ethersync binary to PATH
|
|
run: echo "$PWD/target/release" >> $GITHUB_PATH
|
|
- run: ethersync --version
|
|
- name: Install Neovim
|
|
uses: rhysd/action-setup-vim@v1
|
|
with:
|
|
neovim: true
|
|
version: ${{ matrix.nvim-version }}
|
|
- run: nvim --version
|
|
- name: Install Neovim plugin
|
|
run: |
|
|
mkdir -p $HOME/.local/share/nvim/site/pack/plugins/start
|
|
ln -s $PWD/../nvim-plugin $HOME/.local/share/nvim/site/pack/plugins/start/ethersync
|
|
- name: Compile unit tests
|
|
run: cargo test --no-default-features --no-run --locked
|
|
- name: Run unit tests
|
|
run: cargo test --no-default-features
|
|
- name: Compile integration tests
|
|
working-directory: ./daemon/integration-tests
|
|
run: cargo test --no-run --locked
|
|
- if: ${{ matrix.os == 'ubuntu-latest' && matrix.nvim-version == 'v0.10.4' }}
|
|
name: Run integration tests
|
|
working-directory: ./daemon/integration-tests
|
|
run: cargo test
|
|
- if: ${{ matrix.os != 'ubuntu-latest' || matrix.nvim-version != 'v0.10.4' }}
|
|
name: Run integration tests (without fuzzer)
|
|
working-directory: ./daemon/integration-tests
|
|
run: cargo test --test vim-plugin
|
|
check_formatting:
|
|
name: Check Rust formatting
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- run: cargo fmt --check
|