Files
ethersync-p2p/.github/workflows/general.yml
2025-01-16 08:08:18 -05:00

82 lines
2.4 KiB
YAML

# SPDX-FileCopyrightText: NONE
#
# SPDX-License-Identifier: CC0-1.0
name: General tests
on:
push:
branches:
- 'main'
paths:
- 'daemon/**'
- 'vim-plugin/**'
- '.github/workflows/general.yml'
pull_request:
paths:
- 'daemon/**'
- 'vim-plugin/**'
- '.github/workflows/general.yml'
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0 # See https://corrode.dev/blog/tips-for-faster-rust-compile-times/
jobs:
build_and_test:
name: Run tests
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
nvim-version: [v0.9.5, v0.10.1]
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: ./daemon
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"
- 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/../vim-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.1' }}
name: Run integration tests
working-directory: ./daemon/integration-tests
run: cargo test
- if: ${{ matrix.os == 'macos-latest' || matrix.nvim-version == 'v0.9.5' }}
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
defaults:
run:
working-directory: ./daemon
steps:
- uses: actions/checkout@v4
- run: cargo fmt --check