nushell/.github/workflows/ci.yml

186 lines
4.9 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_PROFILE: ci
NU_LOG_LEVEL: DEBUG
# If changing these settings also change toolkit.nu
CLIPPY_OPTIONS: "-D warnings -D clippy::unwrap_used"
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@v4
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.5.0 to 1.6.0 (#11223) Bumps [actions-rust-lang/setup-rust-toolchain](https://github.com/actions-rust-lang/setup-rust-toolchain) from 1.5.0 to 1.6.0. <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.6.0] - 2023-12-04</h2> <h3>Added</h3> <ul> <li>Allow disabling problem matchers (<a href="https://redirect.github.com/actions-rust-lang/setup-rust-toolchain/issues/27">#27</a>) This can be useful when having a matrix of jobs, that produce the same errors.</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/c7e1de28469b16b21a170a200a7a9e810bb5cdff"><code>c7e1de2</code></a> Update CHANGELOG.md</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/24c9dd087b5bdf193faf173709ed4478ebf9344e"><code>24c9dd0</code></a> Merge pull request <a href="https://redirect.github.com/actions-rust-lang/setup-rust-toolchain/issues/24">#24</a> from obi1kenobi/patch-1</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/74a4154991c69c7d77c06e72401eac5ab476c967"><code>74a4154</code></a> Merge pull request <a href="https://redirect.github.com/actions-rust-lang/setup-rust-toolchain/issues/27">#27</a> from oxideai/feature/config-matcher</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/84ba0c9d1bc8c24a783b6fd3fd94b68b3d3e9909"><code>84ba0c9</code></a> Update README</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/51173b3da485cd71e24a9acbcbe2549aa16fa0b6"><code>51173b3</code></a> feature(matcher): allow disabling problem matcher</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/33678a48c023ee5045cc1fc63ed0b9552de0c8f8"><code>33678a4</code></a> Add docs for the <code>cachekey</code> output to the README</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/317ed623239815a7546843702818759c90ad2cf9"><code>317ed62</code></a> Update example workflow in readme</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/8cb8f77172dea816853dc7b8a8ba48e94182480e"><code>8cb8f77</code></a> Merge pull request <a href="https://redirect.github.com/actions-rust-lang/setup-rust-toolchain/issues/23">#23</a> from actions-rust-lang/dependabot/github_actions/actio...</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/1f541c5b0511767c1f4e99e94906a0b0f6da1000"><code>1f541c5</code></a> Bump actions/checkout from 3 to 4</li> <li>See full diff in <a href="https://github.com/actions-rust-lang/setup-rust-toolchain/compare/v1.5.0...v1.6.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.5.0&new-version=1.6.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 show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@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-12-05 03:42:40 +01:00
uses: actions-rust-lang/setup-rust-toolchain@v1.6.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
# If changing these settings also change toolkit.nu
- name: Clippy
run: cargo clippy --workspace ${{ matrix.flags }} --exclude nu_plugin_* -- $CLIPPY_OPTIONS
# In tests we don't have to deny unwrap
- name: Clippy of tests
run: cargo clippy --tests --workspace ${{ matrix.flags }} --exclude nu_plugin_* -- -D warnings
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@v4
2022-10-30 08:24:10 +01:00
- name: Setup Rust toolchain and cache
Bump actions-rust-lang/setup-rust-toolchain from 1.5.0 to 1.6.0 (#11223) Bumps [actions-rust-lang/setup-rust-toolchain](https://github.com/actions-rust-lang/setup-rust-toolchain) from 1.5.0 to 1.6.0. <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.6.0] - 2023-12-04</h2> <h3>Added</h3> <ul> <li>Allow disabling problem matchers (<a href="https://redirect.github.com/actions-rust-lang/setup-rust-toolchain/issues/27">#27</a>) This can be useful when having a matrix of jobs, that produce the same errors.</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/c7e1de28469b16b21a170a200a7a9e810bb5cdff"><code>c7e1de2</code></a> Update CHANGELOG.md</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/24c9dd087b5bdf193faf173709ed4478ebf9344e"><code>24c9dd0</code></a> Merge pull request <a href="https://redirect.github.com/actions-rust-lang/setup-rust-toolchain/issues/24">#24</a> from obi1kenobi/patch-1</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/74a4154991c69c7d77c06e72401eac5ab476c967"><code>74a4154</code></a> Merge pull request <a href="https://redirect.github.com/actions-rust-lang/setup-rust-toolchain/issues/27">#27</a> from oxideai/feature/config-matcher</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/84ba0c9d1bc8c24a783b6fd3fd94b68b3d3e9909"><code>84ba0c9</code></a> Update README</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/51173b3da485cd71e24a9acbcbe2549aa16fa0b6"><code>51173b3</code></a> feature(matcher): allow disabling problem matcher</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/33678a48c023ee5045cc1fc63ed0b9552de0c8f8"><code>33678a4</code></a> Add docs for the <code>cachekey</code> output to the README</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/317ed623239815a7546843702818759c90ad2cf9"><code>317ed62</code></a> Update example workflow in readme</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/8cb8f77172dea816853dc7b8a8ba48e94182480e"><code>8cb8f77</code></a> Merge pull request <a href="https://redirect.github.com/actions-rust-lang/setup-rust-toolchain/issues/23">#23</a> from actions-rust-lang/dependabot/github_actions/actio...</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/1f541c5b0511767c1f4e99e94906a0b0f6da1000"><code>1f541c5</code></a> Bump actions/checkout from 3 to 4</li> <li>See full diff in <a href="https://github.com/actions-rust-lang/setup-rust-toolchain/compare/v1.5.0...v1.6.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.5.0&new-version=1.6.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 show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@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-12-05 03:42:40 +01:00
uses: actions-rust-lang/setup-rust-toolchain@v1.6.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 }}
- name: Check for clean repo
shell: bash
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "there are changes";
git status --porcelain
exit 1
else
echo "no changes in working directory";
fi
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@v4
2022-10-30 08:24:10 +01:00
- name: Setup Rust toolchain and cache
Bump actions-rust-lang/setup-rust-toolchain from 1.5.0 to 1.6.0 (#11223) Bumps [actions-rust-lang/setup-rust-toolchain](https://github.com/actions-rust-lang/setup-rust-toolchain) from 1.5.0 to 1.6.0. <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.6.0] - 2023-12-04</h2> <h3>Added</h3> <ul> <li>Allow disabling problem matchers (<a href="https://redirect.github.com/actions-rust-lang/setup-rust-toolchain/issues/27">#27</a>) This can be useful when having a matrix of jobs, that produce the same errors.</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/c7e1de28469b16b21a170a200a7a9e810bb5cdff"><code>c7e1de2</code></a> Update CHANGELOG.md</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/24c9dd087b5bdf193faf173709ed4478ebf9344e"><code>24c9dd0</code></a> Merge pull request <a href="https://redirect.github.com/actions-rust-lang/setup-rust-toolchain/issues/24">#24</a> from obi1kenobi/patch-1</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/74a4154991c69c7d77c06e72401eac5ab476c967"><code>74a4154</code></a> Merge pull request <a href="https://redirect.github.com/actions-rust-lang/setup-rust-toolchain/issues/27">#27</a> from oxideai/feature/config-matcher</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/84ba0c9d1bc8c24a783b6fd3fd94b68b3d3e9909"><code>84ba0c9</code></a> Update README</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/51173b3da485cd71e24a9acbcbe2549aa16fa0b6"><code>51173b3</code></a> feature(matcher): allow disabling problem matcher</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/33678a48c023ee5045cc1fc63ed0b9552de0c8f8"><code>33678a4</code></a> Add docs for the <code>cachekey</code> output to the README</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/317ed623239815a7546843702818759c90ad2cf9"><code>317ed62</code></a> Update example workflow in readme</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/8cb8f77172dea816853dc7b8a8ba48e94182480e"><code>8cb8f77</code></a> Merge pull request <a href="https://redirect.github.com/actions-rust-lang/setup-rust-toolchain/issues/23">#23</a> from actions-rust-lang/dependabot/github_actions/actio...</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/1f541c5b0511767c1f4e99e94906a0b0f6da1000"><code>1f541c5</code></a> Bump actions/checkout from 3 to 4</li> <li>See full diff in <a href="https://github.com/actions-rust-lang/setup-rust-toolchain/compare/v1.5.0...v1.6.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.5.0&new-version=1.6.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 show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@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-12-05 03:42:40 +01:00
uses: actions-rust-lang/setup-rust-toolchain@v1.6.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
Bump actions/setup-python from 4 to 5 (#11279) Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4 to 5. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/actions/setup-python/releases">actions/setup-python's releases</a>.</em></p> <blockquote> <h2>v5.0.0</h2> <h2>What's Changed</h2> <p>In scope of this release, we update node version runtime from node16 to node20 (<a href="https://redirect.github.com/actions/setup-python/pull/772">actions/setup-python#772</a>). Besides, we update dependencies to the latest versions.</p> <p><strong>Full Changelog</strong>: <a href="https://github.com/actions/setup-python/compare/v4.8.0...v5.0.0">https://github.com/actions/setup-python/compare/v4.8.0...v5.0.0</a></p> <h2>v4.8.0</h2> <h2>What's Changed</h2> <p>In scope of this release we added support for GraalPy (<a href="https://redirect.github.com/actions/setup-python/pull/694">actions/setup-python#694</a>). You can use this snippet to set up GraalPy:</p> <pre lang="yaml"><code>steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: 'graalpy-22.3' - run: python my_script.py </code></pre> <p>Besides, the release contains such changes as:</p> <ul> <li>Trim python version when reading from file by <a href="https://github.com/FerranPares"><code>@​FerranPares</code></a> in <a href="https://redirect.github.com/actions/setup-python/pull/628">actions/setup-python#628</a></li> <li>Use non-deprecated versions in examples by <a href="https://github.com/jeffwidman"><code>@​jeffwidman</code></a> in <a href="https://redirect.github.com/actions/setup-python/pull/724">actions/setup-python#724</a></li> <li>Change deprecation comment to past tense by <a href="https://github.com/jeffwidman"><code>@​jeffwidman</code></a> in <a href="https://redirect.github.com/actions/setup-python/pull/723">actions/setup-python#723</a></li> <li>Bump <code>@​babel/traverse</code> from 7.9.0 to 7.23.2 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://redirect.github.com/actions/setup-python/pull/743">actions/setup-python#743</a></li> <li>advanced-usage.md: Encourage the use actions/checkout@v4 by <a href="https://github.com/cclauss"><code>@​cclauss</code></a> in <a href="https://redirect.github.com/actions/setup-python/pull/729">actions/setup-python#729</a></li> <li>Examples now use checkout@v4 by <a href="https://github.com/simonw"><code>@​simonw</code></a> in <a href="https://redirect.github.com/actions/setup-python/pull/738">actions/setup-python#738</a></li> <li>Update actions/checkout to v4 by <a href="https://github.com/dmitry-shibanov"><code>@​dmitry-shibanov</code></a> in <a href="https://redirect.github.com/actions/setup-python/pull/761">actions/setup-python#761</a></li> </ul> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/FerranPares"><code>@​FerranPares</code></a> made their first contribution in <a href="https://redirect.github.com/actions/setup-python/pull/628">actions/setup-python#628</a></li> <li><a href="https://github.com/timfel"><code>@​timfel</code></a> made their first contribution in <a href="https://redirect.github.com/actions/setup-python/pull/694">actions/setup-python#694</a></li> <li><a href="https://github.com/jeffwidman"><code>@​jeffwidman</code></a> made their first contribution in <a href="https://redirect.github.com/actions/setup-python/pull/724">actions/setup-python#724</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/actions/setup-python/compare/v4...v4.8.0">https://github.com/actions/setup-python/compare/v4...v4.8.0</a></p> <h2>v4.7.1</h2> <h2>What's Changed</h2> <ul> <li>Bump word-wrap from 1.2.3 to 1.2.4 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://redirect.github.com/actions/setup-python/pull/702">actions/setup-python#702</a></li> <li>Add range validation for toml files by <a href="https://github.com/dmitry-shibanov"><code>@​dmitry-shibanov</code></a> in <a href="https://redirect.github.com/actions/setup-python/pull/726">actions/setup-python#726</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/actions/setup-python/compare/v4...v4.7.1">https://github.com/actions/setup-python/compare/v4...v4.7.1</a></p> <h2>v4.7.0</h2> <p>In scope of this release, the support for reading python version from pyproject.toml was added (<a href="https://redirect.github.com/actions/setup-python/pull/669">actions/setup-python#669</a>).</p> <pre lang="yaml"><code> - name: Setup Python uses: actions/setup-python@v4 &lt;/tr&gt;&lt;/table&gt; </code></pre> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/actions/setup-python/commit/0a5c61591373683505ea898e09a3ea4f39ef2b9c"><code>0a5c615</code></a> Update action to node20 (<a href="https://redirect.github.com/actions/setup-python/issues/772">#772</a>)</li> <li><a href="https://github.com/actions/setup-python/commit/0ae58361cdfd39e2950bed97a1e26aa20c3d8955"><code>0ae5836</code></a> Add example of GraalPy to docs (<a href="https://redirect.github.com/actions/setup-python/issues/773">#773</a>)</li> <li><a href="https://github.com/actions/setup-python/commit/b64ffcaf5b410884ad320a9cfac8866006a109aa"><code>b64ffca</code></a> update actions/checkout to v4 (<a href="https://redirect.github.com/actions/setup-python/issues/761">#761</a>)</li> <li><a href="https://github.com/actions/setup-python/commit/8d2896179abf658742de432b3f203d2c2d86a587"><code>8d28961</code></a> Examples now use checkout@v4 (<a href="https://redirect.github.com/actions/setup-python/issues/738">#738</a>)</li> <li><a href="https://github.com/actions/setup-python/commit/7bc6abb01e0555719edc2dbca70a2fde309e5e56"><code>7bc6abb</code></a> advanced-usage.md: Encourage the use actions/checkout@v4 (<a href="https://redirect.github.com/actions/setup-python/issues/729">#729</a>)</li> <li><a href="https://github.com/actions/setup-python/commit/e8111cec9d3dc15220d8a3b638f08419f57b906a"><code>e8111ce</code></a> Bump <code>@​babel/traverse</code> from 7.9.0 to 7.23.2 (<a href="https://redirect.github.com/actions/setup-python/issues/743">#743</a>)</li> <li><a href="https://github.com/actions/setup-python/commit/a00ea43da65e7c04d2bdae58b3afecd77057eb9e"><code>a00ea43</code></a> add fix for graalpy ci (<a href="https://redirect.github.com/actions/setup-python/issues/741">#741</a>)</li> <li><a href="https://github.com/actions/setup-python/commit/8635b1ccc5934e73ed3510980fd2e7790b85839b"><code>8635b1c</code></a> Change deprecation comment to past tense (<a href="https://redirect.github.com/actions/setup-python/issues/723">#723</a>)</li> <li><a href="https://github.com/actions/setup-python/commit/f6cc428f535856f9c23558d01765a42a4d6cf758"><code>f6cc428</code></a> Use non-deprecated versions in examples (<a href="https://redirect.github.com/actions/setup-python/issues/724">#724</a>)</li> <li><a href="https://github.com/actions/setup-python/commit/5f2af211d616f86005883b44826180b21abb4060"><code>5f2af21</code></a> Add GraalPy support (<a href="https://redirect.github.com/actions/setup-python/issues/694">#694</a>)</li> <li>Additional commits viewable in <a href="https://github.com/actions/setup-python/compare/v4...v5">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/setup-python&package-manager=github_actions&previous-version=4&new-version=5)](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 show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@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-12-15 08:31:18 +01:00
uses: actions/setup-python@v5
2022-03-18 23:36:38 +01:00
with:
python-version: "3.10"
2022-03-18 23:36:38 +01:00
- name: Install virtualenv
run: pip install virtualenv
2022-03-18 23:36:38 +01:00
shell: bash
2022-03-18 23:36:38 +01:00
- name: Test Nushell in virtualenv
run: nu scripts/test_virtualenv.nu
2022-03-18 23:36:38 +01:00
shell: bash
2022-05-02 09:20:57 +02:00
- name: Check for clean repo
shell: bash
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "there are changes";
git status --porcelain
exit 1
else
echo "no changes in working directory";
fi
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@v4
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.5.0 to 1.6.0 (#11223) Bumps [actions-rust-lang/setup-rust-toolchain](https://github.com/actions-rust-lang/setup-rust-toolchain) from 1.5.0 to 1.6.0. <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.6.0] - 2023-12-04</h2> <h3>Added</h3> <ul> <li>Allow disabling problem matchers (<a href="https://redirect.github.com/actions-rust-lang/setup-rust-toolchain/issues/27">#27</a>) This can be useful when having a matrix of jobs, that produce the same errors.</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/c7e1de28469b16b21a170a200a7a9e810bb5cdff"><code>c7e1de2</code></a> Update CHANGELOG.md</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/24c9dd087b5bdf193faf173709ed4478ebf9344e"><code>24c9dd0</code></a> Merge pull request <a href="https://redirect.github.com/actions-rust-lang/setup-rust-toolchain/issues/24">#24</a> from obi1kenobi/patch-1</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/74a4154991c69c7d77c06e72401eac5ab476c967"><code>74a4154</code></a> Merge pull request <a href="https://redirect.github.com/actions-rust-lang/setup-rust-toolchain/issues/27">#27</a> from oxideai/feature/config-matcher</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/84ba0c9d1bc8c24a783b6fd3fd94b68b3d3e9909"><code>84ba0c9</code></a> Update README</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/51173b3da485cd71e24a9acbcbe2549aa16fa0b6"><code>51173b3</code></a> feature(matcher): allow disabling problem matcher</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/33678a48c023ee5045cc1fc63ed0b9552de0c8f8"><code>33678a4</code></a> Add docs for the <code>cachekey</code> output to the README</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/317ed623239815a7546843702818759c90ad2cf9"><code>317ed62</code></a> Update example workflow in readme</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/8cb8f77172dea816853dc7b8a8ba48e94182480e"><code>8cb8f77</code></a> Merge pull request <a href="https://redirect.github.com/actions-rust-lang/setup-rust-toolchain/issues/23">#23</a> from actions-rust-lang/dependabot/github_actions/actio...</li> <li><a href="https://github.com/actions-rust-lang/setup-rust-toolchain/commit/1f541c5b0511767c1f4e99e94906a0b0f6da1000"><code>1f541c5</code></a> Bump actions/checkout from 3 to 4</li> <li>See full diff in <a href="https://github.com/actions-rust-lang/setup-rust-toolchain/compare/v1.5.0...v1.6.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.5.0&new-version=1.6.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 show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@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-12-05 03:42:40 +01:00
uses: actions-rust-lang/setup-rust-toolchain@v1.6.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_*
- name: Check for clean repo
shell: bash
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "there are changes";
git status --porcelain
exit 1
else
echo "no changes in working directory";
fi