nushell/.github/workflows/ci.yml

156 lines
4.3 KiB
YAML
Raw Normal View History

on:
pull_request:
push:
branches:
- main
2021-09-04 09:52:28 +02:00
2022-04-24 15:03:21 +02:00
name: continuous-integration
2021-09-04 09:52:28 +02:00
env:
NUSHELL_CARGO_TARGET: ci
NU_LOG_LEVEL: DEBUG
CLIPPY_OPTIONS: "-D warnings -D clippy::unwrap_used -A clippy::needless_collect -A clippy::result_large_err"
2021-09-04 09:52:28 +02:00
jobs:
fmt-clippy:
2021-09-04 09:52:28 +02:00
strategy:
fail-fast: true
2021-09-04 09:52:28 +02:00
matrix:
# Pinning to Ubuntu 20.04 because building on newer Ubuntu versions causes linux-gnu
# builds to link against a too-new-for-many-Linux-installs glibc version. Consider
# revisiting this when 20.04 is closer to EOL (April 2025)
platform: [windows-latest, macos-latest, ubuntu-20.04]
feature: [default, dataframe, extra]
include:
- feature: default
flags: ""
- feature: dataframe
flags: "--features=dataframe"
- feature: extra
flags: "--features=extra"
exclude:
- platform: windows-latest
feature: dataframe
- platform: macos-latest
feature: dataframe
2021-09-04 09:52:28 +02:00
2021-10-11 21:19:43 +02:00
runs-on: ${{ matrix.platform }}
2021-09-04 09:52:28 +02:00
steps:
- uses: actions/checkout@v3
2021-09-04 09:52:28 +02:00
2022-10-30 08:24:10 +01:00
- name: Setup Rust toolchain and cache
Bump actions-rust-lang/setup-rust-toolchain from 1.4.4 to 1.5.0 (#9363) Bumps [actions-rust-lang/setup-rust-toolchain](https://github.com/actions-rust-lang/setup-rust-toolchain) from 1.4.4 to 1.5.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/actions-rust-lang/setup-rust-toolchain/releases">actions-rust-lang/setup-rust-toolchain's releases</a>.</em></p> <blockquote> <h2>v1.5.0</h2> <h2>What's Changed</h2> <ul> <li>Check that listed components and targets are installed even with a rust-toolchain file by <a href="https://github.com/jonasbb"><code>@​jonasbb</code></a> in <a href="https://redirect.github.com/actions-rust-lang/setup-rust-toolchain/pull/19">actions-rust-lang/setup-rust-toolchain#19</a></li> <li>allow disabling RUSTFLAGS config by <a href="https://github.com/JeanMertz"><code>@​JeanMertz</code></a> in <a href="https://redirect.github.com/actions-rust-lang/setup-rust-toolchain/pull/18">actions-rust-lang/setup-rust-toolchain#18</a></li> </ul> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/JeanMertz"><code>@​JeanMertz</code></a> made their first contribution in <a href="https://redirect.github.com/actions-rust-lang/setup-rust-toolchain/pull/18">actions-rust-lang/setup-rust-toolchain#18</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/actions-rust-lang/setup-rust-toolchain/compare/v1...v1.5.0">https://github.com/actions-rust-lang/setup-rust-toolchain/compare/v1...v1.5.0</a></p> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/actions-rust-lang/setup-rust-toolchain/blob/main/CHANGELOG.md">actions-rust-lang/setup-rust-toolchain's changelog</a>.</em></p> <blockquote> <h2>[1.5.0] - 2023-05-29</h2> <h3>Added</h3> <ul> <li> <p>Support installing additional components and targets that are not listed in <code>rust-toolchain</code> (<a href="https://redirect.github.com/actions-rust-lang/setup-rust-toolchain/issues/14">#14</a>) Before only the items listed in <code>rust-toolchain</code> were installed. Now all the items from the toolchain file are installed and then all the <code>target</code>s and <code>components</code> that are provided as action inputs. This allows installing extra tools only for CI or simplify testing special targets in CI.</p> </li> <li> <p>Allow skipping the creation of a <code>RUSTFLAGS</code> environment variable. Cargos logic for rustflags is complicated, and setting the <code>RUSTFLAGS</code> environment variable prevents other ways of working. Provide a new <code>rustflags</code> input, which controls the environment variable creation. If the value is set to the empty string, then <code>RUSTFLAGS</code> is not created.</p> <p>Pre-existing <code>RUSTFLAGS</code> variables are never modified by this extension.</p> </li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/f3c84ee10bf5a86e7a5d607d487bf17d57670965"><code>f3c84ee</code></a> Merge pull request <a href="https://redirect.github.com/actions-rust-lang/setup-rust-toolchain/issues/18">#18</a> from JeanMertz/rustflags</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/1ef811fbfbdd61296f9a3b8ce232ad25e2530320"><code>1ef811f</code></a> Restore behavior to not touch existing RUSTFLAGS variable</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/70241ab2e90413cc777cbfcedd182e8337bb886a"><code>70241ab</code></a> fixes</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/823a4a135dd7e1bcfc03717aeb5360a52f26916a"><code>823a4a1</code></a> fixes</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/aaa7eef1a2edc8d8a8537b85859e7ed77e91da2a"><code>aaa7eef</code></a> requred -&gt; required</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/24274e4435325db028283c34bfb6f6f518d8af06"><code>24274e4</code></a> allow disabling <code>RUSTFLAGS</code> config</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/cf60eafd0a77fb1a1abb88c71c3d51d346b7cb4e"><code>cf60eaf</code></a> Merge pull request <a href="https://redirect.github.com/actions-rust-lang/setup-rust-toolchain/issues/19">#19</a> from actions-rust-lang/better-toolchain-support</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/289d5e6164cb915bfdbe6d5f0d5e0fafaed2d4b0"><code>289d5e6</code></a> Add changelog</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/661e2d23ddc2fd440e330724c30adbb12a1571de"><code>661e2d2</code></a> Explain the new behavior in the README</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/b065e5ab9fefe5f13e4dfafaf0219438660fbf7b"><code>b065e5a</code></a> Install components and targets after installing everything from the rust-tool...</li> <li>Additional commits viewable in <a href="https://github.com/actions-rust-lang/setup-rust-toolchain/compare/v1.4.4...v1.5.0">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions-rust-lang/setup-rust-toolchain&package-manager=github_actions&previous-version=1.4.4&new-version=1.5.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-13 14:31:23 +02:00
uses: actions-rust-lang/setup-rust-toolchain@v1.5.0
Prevent `rustflags` build config from being ignored in ci workflows (#9513) # Description Prevent `rustflags` build configuration from being ignored in github actions ci workflows. [actions-rust-lang/setup-rust-toolchain](https://github.com/actions-rust-lang/setup-rust-toolchain/) used in ci workflows sets `RUSTFLAGS="-D warnings"` env variable by default. It has priority over some other sources of `rustflags` as described in [the cargo reference](https://doc.rust-lang.org/cargo/reference/config.html#buildrustflags). Nushell is using `target.x86_64-pc-windows-msvc.rustflags` to statically link MSVC runtime in windows platform, but this config is being ignored in ci workflows. By unsetting `RUSTFLAGS` env variable, `rustflags` build configurations will be properly used in ci workflows. I assume that this was the cause of the installer verification failures on the recent winget submission PRs. For more details, refer discussions in https://github.com/microsoft/winget-pkgs/pull/106977 and https://github.com/nushell/nushell/pull/9322#issuecomment-1602932971. # User-Facing Changes Pre-built releases for windows that are created by the release ci workflow will now contain statically linked MSVC runtime. # Tests + Formatting Confirmed successful installation in a windows sandbox instance, which was failing before. It also contains changes made in #9514. Release ci workflow: https://github.com/wolimst/nushell/actions/runs/5357440849 Installer: https://github.com/wolimst/nushell/releases/tag/0.81.0-test # After Submitting Need to check the installer verification result in a winget submission PR for the next release, if this PR gets merged.
2023-06-23 21:53:45 +02:00
with:
rustflags: ""
- name: cargo fmt
run: cargo fmt --all -- --check
- name: Clippy
run: cargo clippy --workspace ${{ matrix.flags }} --exclude nu_plugin_* -- $CLIPPY_OPTIONS
tests:
strategy:
fail-fast: true
matrix:
platform: [windows-latest, macos-latest, ubuntu-20.04]
feature: [default, dataframe, extra]
include:
- feature: default
flags: ""
- feature: dataframe
flags: "--features=dataframe"
- feature: extra
flags: "--features=extra"
exclude:
- platform: windows-latest
feature: dataframe
- platform: macos-latest
feature: dataframe
- platform: windows-latest
feature: extra
- platform: macos-latest
feature: extra
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v3
2022-10-30 08:24:10 +01:00
- name: Setup Rust toolchain and cache
Bump actions-rust-lang/setup-rust-toolchain from 1.4.4 to 1.5.0 (#9363) Bumps [actions-rust-lang/setup-rust-toolchain](https://github.com/actions-rust-lang/setup-rust-toolchain) from 1.4.4 to 1.5.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/actions-rust-lang/setup-rust-toolchain/releases">actions-rust-lang/setup-rust-toolchain's releases</a>.</em></p> <blockquote> <h2>v1.5.0</h2> <h2>What's Changed</h2> <ul> <li>Check that listed components and targets are installed even with a rust-toolchain file by <a href="https://github.com/jonasbb"><code>@​jonasbb</code></a> in <a href="https://redirect.github.com/actions-rust-lang/setup-rust-toolchain/pull/19">actions-rust-lang/setup-rust-toolchain#19</a></li> <li>allow disabling RUSTFLAGS config by <a href="https://github.com/JeanMertz"><code>@​JeanMertz</code></a> in <a href="https://redirect.github.com/actions-rust-lang/setup-rust-toolchain/pull/18">actions-rust-lang/setup-rust-toolchain#18</a></li> </ul> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/JeanMertz"><code>@​JeanMertz</code></a> made their first contribution in <a href="https://redirect.github.com/actions-rust-lang/setup-rust-toolchain/pull/18">actions-rust-lang/setup-rust-toolchain#18</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/actions-rust-lang/setup-rust-toolchain/compare/v1...v1.5.0">https://github.com/actions-rust-lang/setup-rust-toolchain/compare/v1...v1.5.0</a></p> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/actions-rust-lang/setup-rust-toolchain/blob/main/CHANGELOG.md">actions-rust-lang/setup-rust-toolchain's changelog</a>.</em></p> <blockquote> <h2>[1.5.0] - 2023-05-29</h2> <h3>Added</h3> <ul> <li> <p>Support installing additional components and targets that are not listed in <code>rust-toolchain</code> (<a href="https://redirect.github.com/actions-rust-lang/setup-rust-toolchain/issues/14">#14</a>) Before only the items listed in <code>rust-toolchain</code> were installed. Now all the items from the toolchain file are installed and then all the <code>target</code>s and <code>components</code> that are provided as action inputs. This allows installing extra tools only for CI or simplify testing special targets in CI.</p> </li> <li> <p>Allow skipping the creation of a <code>RUSTFLAGS</code> environment variable. Cargos logic for rustflags is complicated, and setting the <code>RUSTFLAGS</code> environment variable prevents other ways of working. Provide a new <code>rustflags</code> input, which controls the environment variable creation. If the value is set to the empty string, then <code>RUSTFLAGS</code> is not created.</p> <p>Pre-existing <code>RUSTFLAGS</code> variables are never modified by this extension.</p> </li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/f3c84ee10bf5a86e7a5d607d487bf17d57670965"><code>f3c84ee</code></a> Merge pull request <a href="https://redirect.github.com/actions-rust-lang/setup-rust-toolchain/issues/18">#18</a> from JeanMertz/rustflags</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/1ef811fbfbdd61296f9a3b8ce232ad25e2530320"><code>1ef811f</code></a> Restore behavior to not touch existing RUSTFLAGS variable</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/70241ab2e90413cc777cbfcedd182e8337bb886a"><code>70241ab</code></a> fixes</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/823a4a135dd7e1bcfc03717aeb5360a52f26916a"><code>823a4a1</code></a> fixes</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/aaa7eef1a2edc8d8a8537b85859e7ed77e91da2a"><code>aaa7eef</code></a> requred -&gt; required</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/24274e4435325db028283c34bfb6f6f518d8af06"><code>24274e4</code></a> allow disabling <code>RUSTFLAGS</code> config</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/cf60eafd0a77fb1a1abb88c71c3d51d346b7cb4e"><code>cf60eaf</code></a> Merge pull request <a href="https://redirect.github.com/actions-rust-lang/setup-rust-toolchain/issues/19">#19</a> from actions-rust-lang/better-toolchain-support</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/289d5e6164cb915bfdbe6d5f0d5e0fafaed2d4b0"><code>289d5e6</code></a> Add changelog</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/661e2d23ddc2fd440e330724c30adbb12a1571de"><code>661e2d2</code></a> Explain the new behavior in the README</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/b065e5ab9fefe5f13e4dfafaf0219438660fbf7b"><code>b065e5a</code></a> Install components and targets after installing everything from the rust-tool...</li> <li>Additional commits viewable in <a href="https://github.com/actions-rust-lang/setup-rust-toolchain/compare/v1.4.4...v1.5.0">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions-rust-lang/setup-rust-toolchain&package-manager=github_actions&previous-version=1.4.4&new-version=1.5.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-13 14:31:23 +02:00
uses: actions-rust-lang/setup-rust-toolchain@v1.5.0
Prevent `rustflags` build config from being ignored in ci workflows (#9513) # Description Prevent `rustflags` build configuration from being ignored in github actions ci workflows. [actions-rust-lang/setup-rust-toolchain](https://github.com/actions-rust-lang/setup-rust-toolchain/) used in ci workflows sets `RUSTFLAGS="-D warnings"` env variable by default. It has priority over some other sources of `rustflags` as described in [the cargo reference](https://doc.rust-lang.org/cargo/reference/config.html#buildrustflags). Nushell is using `target.x86_64-pc-windows-msvc.rustflags` to statically link MSVC runtime in windows platform, but this config is being ignored in ci workflows. By unsetting `RUSTFLAGS` env variable, `rustflags` build configurations will be properly used in ci workflows. I assume that this was the cause of the installer verification failures on the recent winget submission PRs. For more details, refer discussions in https://github.com/microsoft/winget-pkgs/pull/106977 and https://github.com/nushell/nushell/pull/9322#issuecomment-1602932971. # User-Facing Changes Pre-built releases for windows that are created by the release ci workflow will now contain statically linked MSVC runtime. # Tests + Formatting Confirmed successful installation in a windows sandbox instance, which was failing before. It also contains changes made in #9514. Release ci workflow: https://github.com/wolimst/nushell/actions/runs/5357440849 Installer: https://github.com/wolimst/nushell/releases/tag/0.81.0-test # After Submitting Need to check the installer verification result in a winget submission PR for the next release, if this PR gets merged.
2023-06-23 21:53:45 +02:00
with:
rustflags: ""
- name: Tests
run: cargo test --workspace --profile ci --exclude nu_plugin_* ${{ matrix.flags }}
standard library: bring the tests into the main CI (#8525) Should close one of the tasks in #8450. # Description > **Note** > in order of appearance in the global diff - 1b7497c41966306aa3103a95a9b5ef5df7111ee4 adds the `std-tests` job to the CI which 1. installs `nushell` in the runner 2. run the `tests.nu` module > see `open .github/workflows/ci.yml | get jobs.std-tests | to yaml` - [`ec85b6fd`..`9c122115`](ec85b6fd3fc004cd94e3fada5c8e5fe2714fd629..9c12211564ca8ee90ed65ae45776dccb8f8e4ef1) is where all the magic happens => see below - :test_tube: 799c7eb7fd5f140289b36b9dbc00329c50e2fbda introduces some bugs and failing test to see how the CI behaves => see how the [tests failed](https://github.com/nushell/nushell/actions/runs/4460098237/jobs/7833018256) as expected :x: - :test_tube: and c3de1fafb5c5313e30c08c9ca57e09df33b61b74 reverts the failing tests, i.e. the previous commit, leaving a standard library whose tests all pass :tada: => see the [tests passing](https://github.com/nushell/nushell/actions/runs/4460153434/jobs/7833110719?pr=8525#step:5:1) now :heavy_check_mark: ## the changes to the runner > see [`ec85b6fd`..`9c122115`](ec85b6fd3fc004cd94e3fada5c8e5fe2714fd629..9c12211564ca8ee90ed65ae45776dccb8f8e4ef1) the issue with the previous runner was the following: the clever trick of using `nu -c "use ...; test"` did print the errors when occuring but they did not capture the true "failure", i.e. in all cases the `$env.LAST_EXIT_CODE` was set to `0`, never stopping the CI when a test failed :thinking: i first tried to `try` / `catch` the error in ec85b6fd3fc004cd94e3fada5c8e5fe2714fd629 which kinda worked but only throw a single error, the first one i thought it was not the best and started thinking about a solution to have a complete report of all failing tests, at once, to avoid running the CI multiple times! the easiest solution i found was the one i implemented in 9c12211564ca8ee90ed65ae45776dccb8f8e4ef1 > **Warning** > this changes the structure of the runner quite a bit, but the `for` loops where annoying to manipulate structured data and allow the runner to draw a complete report... now the runner does the following - compute the list of all available tests in a table with the `file`, `module` and `name` columns (first part of the pipe until `flatten` and `rename`) - run the tests one by one computing the new `pass` column - with a `log info` - captures the failing ones => puts `true` in `pass` if the test passes, `false` otherwise - if at least one test has failed, throw a single error with the list of failing tests ### hope you'll like it :relieved: # User-Facing Changes ``` $nothing ``` # Tests + Formatting the standard tests now return a true error that will stop the CI # After Submitting ``` $nothing ```
2023-03-25 19:29:08 +01:00
std-lib-and-python-virtualenv:
strategy:
fail-fast: true
matrix:
platform: [ubuntu-20.04, macos-latest, windows-latest]
2022-03-18 23:36:38 +01:00
py:
- py
runs-on: ${{ matrix.platform }}
2021-09-04 09:52:28 +02:00
steps:
- uses: actions/checkout@v3
2022-10-30 08:24:10 +01:00
- name: Setup Rust toolchain and cache
Bump actions-rust-lang/setup-rust-toolchain from 1.4.4 to 1.5.0 (#9363) Bumps [actions-rust-lang/setup-rust-toolchain](https://github.com/actions-rust-lang/setup-rust-toolchain) from 1.4.4 to 1.5.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/actions-rust-lang/setup-rust-toolchain/releases">actions-rust-lang/setup-rust-toolchain's releases</a>.</em></p> <blockquote> <h2>v1.5.0</h2> <h2>What's Changed</h2> <ul> <li>Check that listed components and targets are installed even with a rust-toolchain file by <a href="https://github.com/jonasbb"><code>@​jonasbb</code></a> in <a href="https://redirect.github.com/actions-rust-lang/setup-rust-toolchain/pull/19">actions-rust-lang/setup-rust-toolchain#19</a></li> <li>allow disabling RUSTFLAGS config by <a href="https://github.com/JeanMertz"><code>@​JeanMertz</code></a> in <a href="https://redirect.github.com/actions-rust-lang/setup-rust-toolchain/pull/18">actions-rust-lang/setup-rust-toolchain#18</a></li> </ul> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/JeanMertz"><code>@​JeanMertz</code></a> made their first contribution in <a href="https://redirect.github.com/actions-rust-lang/setup-rust-toolchain/pull/18">actions-rust-lang/setup-rust-toolchain#18</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/actions-rust-lang/setup-rust-toolchain/compare/v1...v1.5.0">https://github.com/actions-rust-lang/setup-rust-toolchain/compare/v1...v1.5.0</a></p> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/actions-rust-lang/setup-rust-toolchain/blob/main/CHANGELOG.md">actions-rust-lang/setup-rust-toolchain's changelog</a>.</em></p> <blockquote> <h2>[1.5.0] - 2023-05-29</h2> <h3>Added</h3> <ul> <li> <p>Support installing additional components and targets that are not listed in <code>rust-toolchain</code> (<a href="https://redirect.github.com/actions-rust-lang/setup-rust-toolchain/issues/14">#14</a>) Before only the items listed in <code>rust-toolchain</code> were installed. Now all the items from the toolchain file are installed and then all the <code>target</code>s and <code>components</code> that are provided as action inputs. This allows installing extra tools only for CI or simplify testing special targets in CI.</p> </li> <li> <p>Allow skipping the creation of a <code>RUSTFLAGS</code> environment variable. Cargos logic for rustflags is complicated, and setting the <code>RUSTFLAGS</code> environment variable prevents other ways of working. Provide a new <code>rustflags</code> input, which controls the environment variable creation. If the value is set to the empty string, then <code>RUSTFLAGS</code> is not created.</p> <p>Pre-existing <code>RUSTFLAGS</code> variables are never modified by this extension.</p> </li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/f3c84ee10bf5a86e7a5d607d487bf17d57670965"><code>f3c84ee</code></a> Merge pull request <a href="https://redirect.github.com/actions-rust-lang/setup-rust-toolchain/issues/18">#18</a> from JeanMertz/rustflags</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/1ef811fbfbdd61296f9a3b8ce232ad25e2530320"><code>1ef811f</code></a> Restore behavior to not touch existing RUSTFLAGS variable</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/70241ab2e90413cc777cbfcedd182e8337bb886a"><code>70241ab</code></a> fixes</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/823a4a135dd7e1bcfc03717aeb5360a52f26916a"><code>823a4a1</code></a> fixes</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/aaa7eef1a2edc8d8a8537b85859e7ed77e91da2a"><code>aaa7eef</code></a> requred -&gt; required</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/24274e4435325db028283c34bfb6f6f518d8af06"><code>24274e4</code></a> allow disabling <code>RUSTFLAGS</code> config</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/cf60eafd0a77fb1a1abb88c71c3d51d346b7cb4e"><code>cf60eaf</code></a> Merge pull request <a href="https://redirect.github.com/actions-rust-lang/setup-rust-toolchain/issues/19">#19</a> from actions-rust-lang/better-toolchain-support</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/289d5e6164cb915bfdbe6d5f0d5e0fafaed2d4b0"><code>289d5e6</code></a> Add changelog</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/661e2d23ddc2fd440e330724c30adbb12a1571de"><code>661e2d2</code></a> Explain the new behavior in the README</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/b065e5ab9fefe5f13e4dfafaf0219438660fbf7b"><code>b065e5a</code></a> Install components and targets after installing everything from the rust-tool...</li> <li>Additional commits viewable in <a href="https://github.com/actions-rust-lang/setup-rust-toolchain/compare/v1.4.4...v1.5.0">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions-rust-lang/setup-rust-toolchain&package-manager=github_actions&previous-version=1.4.4&new-version=1.5.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-13 14:31:23 +02:00
uses: actions-rust-lang/setup-rust-toolchain@v1.5.0
Prevent `rustflags` build config from being ignored in ci workflows (#9513) # Description Prevent `rustflags` build configuration from being ignored in github actions ci workflows. [actions-rust-lang/setup-rust-toolchain](https://github.com/actions-rust-lang/setup-rust-toolchain/) used in ci workflows sets `RUSTFLAGS="-D warnings"` env variable by default. It has priority over some other sources of `rustflags` as described in [the cargo reference](https://doc.rust-lang.org/cargo/reference/config.html#buildrustflags). Nushell is using `target.x86_64-pc-windows-msvc.rustflags` to statically link MSVC runtime in windows platform, but this config is being ignored in ci workflows. By unsetting `RUSTFLAGS` env variable, `rustflags` build configurations will be properly used in ci workflows. I assume that this was the cause of the installer verification failures on the recent winget submission PRs. For more details, refer discussions in https://github.com/microsoft/winget-pkgs/pull/106977 and https://github.com/nushell/nushell/pull/9322#issuecomment-1602932971. # User-Facing Changes Pre-built releases for windows that are created by the release ci workflow will now contain statically linked MSVC runtime. # Tests + Formatting Confirmed successful installation in a windows sandbox instance, which was failing before. It also contains changes made in #9514. Release ci workflow: https://github.com/wolimst/nushell/actions/runs/5357440849 Installer: https://github.com/wolimst/nushell/releases/tag/0.81.0-test # After Submitting Need to check the installer verification result in a winget submission PR for the next release, if this PR gets merged.
2023-06-23 21:53:45 +02:00
with:
rustflags: ""
- name: Install Nushell
standard library: bring the tests into the main CI (#8525) Should close one of the tasks in #8450. # Description > **Note** > in order of appearance in the global diff - 1b7497c41966306aa3103a95a9b5ef5df7111ee4 adds the `std-tests` job to the CI which 1. installs `nushell` in the runner 2. run the `tests.nu` module > see `open .github/workflows/ci.yml | get jobs.std-tests | to yaml` - [`ec85b6fd`..`9c122115`](ec85b6fd3fc004cd94e3fada5c8e5fe2714fd629..9c12211564ca8ee90ed65ae45776dccb8f8e4ef1) is where all the magic happens => see below - :test_tube: 799c7eb7fd5f140289b36b9dbc00329c50e2fbda introduces some bugs and failing test to see how the CI behaves => see how the [tests failed](https://github.com/nushell/nushell/actions/runs/4460098237/jobs/7833018256) as expected :x: - :test_tube: and c3de1fafb5c5313e30c08c9ca57e09df33b61b74 reverts the failing tests, i.e. the previous commit, leaving a standard library whose tests all pass :tada: => see the [tests passing](https://github.com/nushell/nushell/actions/runs/4460153434/jobs/7833110719?pr=8525#step:5:1) now :heavy_check_mark: ## the changes to the runner > see [`ec85b6fd`..`9c122115`](ec85b6fd3fc004cd94e3fada5c8e5fe2714fd629..9c12211564ca8ee90ed65ae45776dccb8f8e4ef1) the issue with the previous runner was the following: the clever trick of using `nu -c "use ...; test"` did print the errors when occuring but they did not capture the true "failure", i.e. in all cases the `$env.LAST_EXIT_CODE` was set to `0`, never stopping the CI when a test failed :thinking: i first tried to `try` / `catch` the error in ec85b6fd3fc004cd94e3fada5c8e5fe2714fd629 which kinda worked but only throw a single error, the first one i thought it was not the best and started thinking about a solution to have a complete report of all failing tests, at once, to avoid running the CI multiple times! the easiest solution i found was the one i implemented in 9c12211564ca8ee90ed65ae45776dccb8f8e4ef1 > **Warning** > this changes the structure of the runner quite a bit, but the `for` loops where annoying to manipulate structured data and allow the runner to draw a complete report... now the runner does the following - compute the list of all available tests in a table with the `file`, `module` and `name` columns (first part of the pipe until `flatten` and `rename`) - run the tests one by one computing the new `pass` column - with a `log info` - captures the failing ones => puts `true` in `pass` if the test passes, `false` otherwise - if at least one test has failed, throw a single error with the list of failing tests ### hope you'll like it :relieved: # User-Facing Changes ``` $nothing ``` # Tests + Formatting the standard tests now return a true error that will stop the CI # After Submitting ``` $nothing ```
2023-03-25 19:29:08 +01:00
run: cargo install --path . --locked --no-default-features
- name: Standard library tests
run: nu -c 'use std testing; testing run-tests --path crates/nu-std'
2022-03-18 23:36:38 +01:00
- name: Setup Python
uses: actions/setup-python@v4
2022-03-18 23:36:38 +01:00
with:
python-version: "3.10"
2022-03-18 23:36:38 +01:00
- run: python -m pip install tox
2022-03-18 23:36:38 +01:00
- name: Install virtualenv
run: git clone https://github.com/pypa/virtualenv.git
2022-03-18 23:36:38 +01:00
shell: bash
2022-03-18 23:36:38 +01:00
- name: Test Nushell in virtualenv
run: |
cd virtualenv
# if we encounter problems with bleeding edge tests pin to the latest tag
# git checkout $(git describe --tags | cut -d - -f 1)
# We need to disable failing on coverage levels.
nu -c "open pyproject.toml | upsert tool.coverage.report.fail_under 1 | save patchproject.toml"
mv patchproject.toml pyproject.toml
tox -e ${{ matrix.py }} -- -k nushell
2022-03-18 23:36:38 +01:00
shell: bash
2022-05-02 09:20:57 +02:00
plugins:
strategy:
fail-fast: true
2022-05-02 09:20:57 +02:00
matrix:
platform: [windows-latest, macos-latest, ubuntu-20.04]
2022-05-02 09:20:57 +02:00
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v3
2022-05-02 09:20:57 +02:00
2022-10-30 08:24:10 +01:00
- name: Setup Rust toolchain and cache
Bump actions-rust-lang/setup-rust-toolchain from 1.4.4 to 1.5.0 (#9363) Bumps [actions-rust-lang/setup-rust-toolchain](https://github.com/actions-rust-lang/setup-rust-toolchain) from 1.4.4 to 1.5.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/actions-rust-lang/setup-rust-toolchain/releases">actions-rust-lang/setup-rust-toolchain's releases</a>.</em></p> <blockquote> <h2>v1.5.0</h2> <h2>What's Changed</h2> <ul> <li>Check that listed components and targets are installed even with a rust-toolchain file by <a href="https://github.com/jonasbb"><code>@​jonasbb</code></a> in <a href="https://redirect.github.com/actions-rust-lang/setup-rust-toolchain/pull/19">actions-rust-lang/setup-rust-toolchain#19</a></li> <li>allow disabling RUSTFLAGS config by <a href="https://github.com/JeanMertz"><code>@​JeanMertz</code></a> in <a href="https://redirect.github.com/actions-rust-lang/setup-rust-toolchain/pull/18">actions-rust-lang/setup-rust-toolchain#18</a></li> </ul> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/JeanMertz"><code>@​JeanMertz</code></a> made their first contribution in <a href="https://redirect.github.com/actions-rust-lang/setup-rust-toolchain/pull/18">actions-rust-lang/setup-rust-toolchain#18</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/actions-rust-lang/setup-rust-toolchain/compare/v1...v1.5.0">https://github.com/actions-rust-lang/setup-rust-toolchain/compare/v1...v1.5.0</a></p> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/actions-rust-lang/setup-rust-toolchain/blob/main/CHANGELOG.md">actions-rust-lang/setup-rust-toolchain's changelog</a>.</em></p> <blockquote> <h2>[1.5.0] - 2023-05-29</h2> <h3>Added</h3> <ul> <li> <p>Support installing additional components and targets that are not listed in <code>rust-toolchain</code> (<a href="https://redirect.github.com/actions-rust-lang/setup-rust-toolchain/issues/14">#14</a>) Before only the items listed in <code>rust-toolchain</code> were installed. Now all the items from the toolchain file are installed and then all the <code>target</code>s and <code>components</code> that are provided as action inputs. This allows installing extra tools only for CI or simplify testing special targets in CI.</p> </li> <li> <p>Allow skipping the creation of a <code>RUSTFLAGS</code> environment variable. Cargos logic for rustflags is complicated, and setting the <code>RUSTFLAGS</code> environment variable prevents other ways of working. Provide a new <code>rustflags</code> input, which controls the environment variable creation. If the value is set to the empty string, then <code>RUSTFLAGS</code> is not created.</p> <p>Pre-existing <code>RUSTFLAGS</code> variables are never modified by this extension.</p> </li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/f3c84ee10bf5a86e7a5d607d487bf17d57670965"><code>f3c84ee</code></a> Merge pull request <a href="https://redirect.github.com/actions-rust-lang/setup-rust-toolchain/issues/18">#18</a> from JeanMertz/rustflags</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/1ef811fbfbdd61296f9a3b8ce232ad25e2530320"><code>1ef811f</code></a> Restore behavior to not touch existing RUSTFLAGS variable</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/70241ab2e90413cc777cbfcedd182e8337bb886a"><code>70241ab</code></a> fixes</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/823a4a135dd7e1bcfc03717aeb5360a52f26916a"><code>823a4a1</code></a> fixes</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/aaa7eef1a2edc8d8a8537b85859e7ed77e91da2a"><code>aaa7eef</code></a> requred -&gt; required</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/24274e4435325db028283c34bfb6f6f518d8af06"><code>24274e4</code></a> allow disabling <code>RUSTFLAGS</code> config</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/cf60eafd0a77fb1a1abb88c71c3d51d346b7cb4e"><code>cf60eaf</code></a> Merge pull request <a href="https://redirect.github.com/actions-rust-lang/setup-rust-toolchain/issues/19">#19</a> from actions-rust-lang/better-toolchain-support</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/289d5e6164cb915bfdbe6d5f0d5e0fafaed2d4b0"><code>289d5e6</code></a> Add changelog</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/661e2d23ddc2fd440e330724c30adbb12a1571de"><code>661e2d2</code></a> Explain the new behavior in the README</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/b065e5ab9fefe5f13e4dfafaf0219438660fbf7b"><code>b065e5a</code></a> Install components and targets after installing everything from the rust-tool...</li> <li>Additional commits viewable in <a href="https://github.com/actions-rust-lang/setup-rust-toolchain/compare/v1.4.4...v1.5.0">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions-rust-lang/setup-rust-toolchain&package-manager=github_actions&previous-version=1.4.4&new-version=1.5.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-13 14:31:23 +02:00
uses: actions-rust-lang/setup-rust-toolchain@v1.5.0
Prevent `rustflags` build config from being ignored in ci workflows (#9513) # Description Prevent `rustflags` build configuration from being ignored in github actions ci workflows. [actions-rust-lang/setup-rust-toolchain](https://github.com/actions-rust-lang/setup-rust-toolchain/) used in ci workflows sets `RUSTFLAGS="-D warnings"` env variable by default. It has priority over some other sources of `rustflags` as described in [the cargo reference](https://doc.rust-lang.org/cargo/reference/config.html#buildrustflags). Nushell is using `target.x86_64-pc-windows-msvc.rustflags` to statically link MSVC runtime in windows platform, but this config is being ignored in ci workflows. By unsetting `RUSTFLAGS` env variable, `rustflags` build configurations will be properly used in ci workflows. I assume that this was the cause of the installer verification failures on the recent winget submission PRs. For more details, refer discussions in https://github.com/microsoft/winget-pkgs/pull/106977 and https://github.com/nushell/nushell/pull/9322#issuecomment-1602932971. # User-Facing Changes Pre-built releases for windows that are created by the release ci workflow will now contain statically linked MSVC runtime. # Tests + Formatting Confirmed successful installation in a windows sandbox instance, which was failing before. It also contains changes made in #9514. Release ci workflow: https://github.com/wolimst/nushell/actions/runs/5357440849 Installer: https://github.com/wolimst/nushell/releases/tag/0.81.0-test # After Submitting Need to check the installer verification result in a winget submission PR for the next release, if this PR gets merged.
2023-06-23 21:53:45 +02:00
with:
rustflags: ""
2022-05-02 09:20:57 +02:00
- name: Clippy
run: cargo clippy --package nu_plugin_* ${{ matrix.flags }} -- $CLIPPY_OPTIONS
2022-05-02 09:20:57 +02:00
- name: Tests
run: cargo test --profile ci --package nu_plugin_*