mirror of
https://github.com/nushell/nushell
synced 2025-01-13 21:55:07 +00:00
Update CI (#4445)
* Add different features combinations * Specify styles manually * Fix args * Fix typo * Let other CI jobs finish if one fails * Fix unused symbols without plugin feature * Put "which" tests behind "which" feature * Add Python virtualenv job * Oops forgot git command * Install Nushell in virtualenv tests * Add names to steps; Test v.env in separate step * cd into virtualenv * Do not run on Python 2.7 * Build Nushell after formatting and clippy checks
This commit is contained in:
parent
eceb2d5106
commit
94a0e3060a
3 changed files with 80 additions and 14 deletions
89
.github/workflows/ci.yml
vendored
89
.github/workflows/ci.yml
vendored
|
@ -5,38 +5,101 @@ name: Continuous integration
|
|||
jobs:
|
||||
ci:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
platform: [ubuntu-latest, macos-latest, windows-latest]
|
||||
style: [minimal, default, all]
|
||||
rust:
|
||||
- stable
|
||||
include:
|
||||
- style: minimal
|
||||
flags: '--no-default-features'
|
||||
- style: default
|
||||
flags: ''
|
||||
- style: all
|
||||
flags: '--all-features'
|
||||
|
||||
runs-on: ${{ matrix.platform }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: actions-rs/toolchain@v1
|
||||
- name: Setup Rust toolchain
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: ${{ matrix.rust }}
|
||||
override: true
|
||||
components: rustfmt, clippy
|
||||
|
||||
- uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: build
|
||||
|
||||
- uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: test
|
||||
args: --all --all-features
|
||||
|
||||
- uses: actions-rs/cargo@v1
|
||||
- name: Rustfmt
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: fmt
|
||||
args: --all -- --check
|
||||
|
||||
- uses: actions-rs/cargo@v1
|
||||
- name: Clippy
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: clippy
|
||||
args: --all --all-features -- -D warnings -D clippy::unwrap_used -A clippy::needless_collect
|
||||
args: --all ${{ matrix.flags }} -- -D warnings -D clippy::unwrap_used -A clippy::needless_collect
|
||||
|
||||
- name: Build Nushell
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: build
|
||||
args: ${{ matrix.flags }}
|
||||
|
||||
- name: Tests
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: test
|
||||
args: --all ${{ matrix.flags }}
|
||||
|
||||
|
||||
python-virtualenv:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
platform: [ubuntu-latest, macos-latest, windows-latest]
|
||||
rust:
|
||||
- stable
|
||||
py:
|
||||
- py
|
||||
|
||||
runs-on: ${{ matrix.platform }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Setup Rust toolchain
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: ${{ matrix.rust }}
|
||||
override: true
|
||||
components: rustfmt, clippy
|
||||
|
||||
- name: Install Nushell
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: install
|
||||
args: --path=. --no-default-features
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: "3.10"
|
||||
|
||||
- run: python -m pip install tox
|
||||
|
||||
- name: Install virtualenv
|
||||
run: |
|
||||
git clone https://github.com/kubouch/virtualenv.git && \
|
||||
cd virtualenv && \
|
||||
git checkout engine-q-update
|
||||
shell: bash
|
||||
|
||||
- name: Test Nushell in virtualenv
|
||||
run: cd virtualenv && tox -e ${{ matrix.py }} -- -k nushell
|
||||
shell: bash
|
||||
|
|
|
@ -61,6 +61,7 @@ mod touch;
|
|||
mod uniq;
|
||||
mod update;
|
||||
mod where_;
|
||||
#[cfg(feature = "which")]
|
||||
mod which;
|
||||
mod with_env;
|
||||
mod wrap;
|
||||
|
|
|
@ -5,10 +5,12 @@ use nu_protocol::engine::{EngineState, Stack, StateDelta, StateWorkingSet};
|
|||
use std::path::PathBuf;
|
||||
|
||||
const NUSHELL_FOLDER: &str = "nushell";
|
||||
const PLUGIN_FILE: &str = "plugin.nu";
|
||||
const CONFIG_FILE: &str = "config.nu";
|
||||
const HISTORY_FILE: &str = "history.txt";
|
||||
#[cfg(feature = "plugin")]
|
||||
const PLUGIN_FILE: &str = "plugin.nu";
|
||||
|
||||
#[cfg(feature = "plugin")]
|
||||
pub(crate) fn read_plugin_file(engine_state: &mut EngineState, stack: &mut Stack) {
|
||||
// Reading signatures from signature file
|
||||
// The plugin.nu file stores the parsed signature collected from each registered plugin
|
||||
|
|
Loading…
Reference in a new issue