Skip to content

Commit

Permalink
Try to fix nightly
Browse files Browse the repository at this point in the history
  • Loading branch information
hustcer committed Apr 27, 2024
2 parents 1e2f34e + 76d1d70 commit 1433e9b
Show file tree
Hide file tree
Showing 1,189 changed files with 60,734 additions and 23,614 deletions.
11 changes: 0 additions & 11 deletions .github/ISSUE_TEMPLATE/standard-library-bug-or-feature-report.md

This file was deleted.

5 changes: 5 additions & 0 deletions .github/dependabot.yml
Expand Up @@ -11,10 +11,15 @@ updates:
directory: "/"
schedule:
interval: "weekly"
# We release on Tuesdays and open dependabot PRs will rebase after the
# version bump and thus consume unnecessary workers during release, thus
# let's open new ones on Wednesday
day: "wednesday"
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-patch"]
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "wednesday"
2 changes: 1 addition & 1 deletion .github/workflows/audit.yml
Expand Up @@ -19,7 +19,7 @@ jobs:
# Prevent sudden announcement of a new advisory from failing ci:
continue-on-error: true
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4.1.3
- uses: rustsec/audit-check@v1.4.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
12 changes: 12 additions & 0 deletions .github/workflows/check-msrv.nu
@@ -0,0 +1,12 @@
let toolchain_spec = open rust-toolchain.toml | get toolchain.channel
let msrv_spec = open Cargo.toml | get package.rust-version

# This check is conservative in the sense that we use `rust-toolchain.toml`'s
# override to ensure that this is the upper-bound for the minimum supported
# rust version
if $toolchain_spec != $msrv_spec {
print -e "Mismatching rust compiler versions specified in `Cargo.toml` and `rust-toolchain.toml`"
print -e $"Cargo.toml: ($msrv_spec)"
print -e $"rust-toolchain.toml: ($toolchain_spec)"
exit 1
}
48 changes: 29 additions & 19 deletions .github/workflows/ci.yml
Expand Up @@ -10,7 +10,11 @@ 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"
CLIPPY_OPTIONS: "-D warnings -D clippy::unwrap_used -D clippy::unchecked_duration_subtraction"

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
cancel-in-progress: true

jobs:
fmt-clippy:
Expand All @@ -20,25 +24,27 @@ jobs:
# 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]
#
# Using macOS 13 runner because 14 is based on the M1 and has half as much RAM (7 GB,
# instead of 14 GB) which is too little for us right now. Revisit when `dfr` commands are
# removed and we're only building the `polars` plugin instead
platform: [windows-latest, macos-13, ubuntu-20.04]
feature: [default, dataframe]
include:
- feature: default
flags: ""
- feature: dataframe
flags: "--features=dataframe"
- feature: extra
flags: "--features=extra"
exclude:
- platform: windows-latest
feature: dataframe
- platform: macos-latest
- platform: macos-13
feature: dataframe

runs-on: ${{ matrix.platform }}

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4.1.3

- name: Setup Rust toolchain and cache
uses: actions-rust-lang/setup-rust-toolchain@v1.8.0
Expand All @@ -56,12 +62,15 @@ jobs:
- name: Clippy of tests
run: cargo clippy --tests --workspace ${{ matrix.flags }} --exclude nu_plugin_* -- -D warnings

- name: Clippy of benchmarks
run: cargo clippy --benches --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]
feature: [default, dataframe]
include:
# linux CI cannot handle clipboard feature
- default-flags: ""
Expand All @@ -71,22 +80,16 @@ jobs:
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
- uses: actions/checkout@v4.1.3

- name: Setup Rust toolchain and cache
uses: actions-rust-lang/setup-rust-toolchain@v1.8.0
Expand Down Expand Up @@ -118,7 +121,7 @@ jobs:
runs-on: ${{ matrix.platform }}

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4.1.3

- name: Setup Rust toolchain and cache
uses: actions-rust-lang/setup-rust-toolchain@v1.8.0
Expand All @@ -131,6 +134,9 @@ jobs:
- name: Standard library tests
run: nu -c 'use crates/nu-std/testing.nu; testing run-tests --path crates/nu-std'

- name: Ensure that Cargo.toml MSRV and rust-toolchain.toml use the same version
run: nu .github/workflows/check-msrv.nu

- name: Setup Python
uses: actions/setup-python@v5
with:
Expand Down Expand Up @@ -159,20 +165,24 @@ jobs:
strategy:
fail-fast: true
matrix:
platform: [windows-latest, macos-latest, ubuntu-20.04]
# Using macOS 13 runner because 14 is based on the M1 and has half as much RAM (7 GB,
# instead of 14 GB) which is too little for us right now.
#
# Failure occuring with clippy for rust 1.77.2
platform: [windows-latest, macos-13, ubuntu-20.04]

runs-on: ${{ matrix.platform }}

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4.1.3

- name: Setup Rust toolchain and cache
uses: actions-rust-lang/setup-rust-toolchain@v1.8.0
with:
rustflags: ""

- name: Clippy
run: cargo clippy --package nu_plugin_* ${{ matrix.flags }} -- $CLIPPY_OPTIONS
run: cargo clippy --package nu_plugin_* -- $CLIPPY_OPTIONS

- name: Tests
run: cargo test --profile ci --package nu_plugin_*
Expand Down
52 changes: 26 additions & 26 deletions .github/workflows/nightly-build.yml
Expand Up @@ -27,7 +27,7 @@ jobs:
# if: github.repository == 'nushell/nightly'
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v4.1.3
if: github.repository == 'nushell/nightly'
with:
ref: main
Expand All @@ -36,10 +36,10 @@ jobs:
token: ${{ secrets.WORKFLOW_TOKEN }}

- name: Setup Nushell
uses: hustcer/setup-nu@v3.9
uses: hustcer/setup-nu@v3.10
if: github.repository == 'nushell/nightly'
with:
version: 0.90.1
version: 0.92.2

# Synchronize the main branch of nightly repo with the main branch of Nushell official repo
- name: Prepare for Nightly Release
Expand Down Expand Up @@ -123,7 +123,7 @@ jobs:
runs-on: ${{matrix.os}}

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4.1.3
with:
ref: main
fetch-depth: 0
Expand All @@ -139,9 +139,9 @@ jobs:
rustflags: ''

- name: Setup Nushell
uses: hustcer/setup-nu@v3.9
uses: hustcer/setup-nu@v3.10
with:
version: 0.90.1
version: 0.92.2

- name: Release Nu Binary
id: nu
Expand Down Expand Up @@ -174,7 +174,7 @@ jobs:
# REF: https://github.com/marketplace/actions/gh-release
# Create a release only in nushell/nightly repo
- name: Publish Archive
uses: softprops/action-gh-release@v0.1.15
uses: softprops/action-gh-release@v2.0.4
if: ${{ startsWith(github.repository, 'nushell/nightly') }}
with:
prerelease: true
Expand Down Expand Up @@ -202,40 +202,40 @@ jobs:
include:
- target: aarch64-apple-darwin
os: macos-latest
target_rustflags: '--features=dataframe,extra'
target_rustflags: '--features=dataframe'
- target: x86_64-apple-darwin
os: macos-latest
target_rustflags: '--features=dataframe,extra'
target_rustflags: '--features=dataframe'
- target: x86_64-pc-windows-msvc
extra: 'bin'
os: windows-latest
target_rustflags: '--features=dataframe,extra'
target_rustflags: '--features=dataframe'
- target: x86_64-pc-windows-msvc
extra: msi
os: windows-latest
target_rustflags: '--features=dataframe,extra'
target_rustflags: '--features=dataframe'
- target: aarch64-pc-windows-msvc
extra: 'bin'
os: windows-latest
target_rustflags: '--features=dataframe,extra'
target_rustflags: '--features=dataframe'
- target: aarch64-pc-windows-msvc
extra: msi
os: windows-latest
target_rustflags: '--features=dataframe,extra'
target_rustflags: '--features=dataframe'
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
target_rustflags: '--features=dataframe,extra'
os: ubuntu-20.04
target_rustflags: '--features=dataframe'
- target: x86_64-unknown-linux-musl
os: ubuntu-latest
target_rustflags: '--features=dataframe,extra'
os: ubuntu-20.04
target_rustflags: '--features=dataframe'
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
target_rustflags: '--features=dataframe,extra'
os: ubuntu-20.04
target_rustflags: '--features=dataframe'

runs-on: ${{matrix.os}}

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4.1.3
with:
ref: main
fetch-depth: 0
Expand All @@ -251,9 +251,9 @@ jobs:
rustflags: ''

- name: Setup Nushell
uses: hustcer/setup-nu@v3.9
uses: hustcer/setup-nu@v3.10
with:
version: 0.90.1
version: 0.92.2

- name: Release Nu Binary
id: nu
Expand Down Expand Up @@ -286,7 +286,7 @@ jobs:
# REF: https://github.com/marketplace/actions/gh-release
# Create a release only in nushell/nightly repo
- name: Publish Archive
uses: softprops/action-gh-release@v0.1.15
uses: softprops/action-gh-release@v2.0.4
if: ${{ startsWith(github.repository, 'nushell/nightly') }}
with:
draft: false
Expand All @@ -310,14 +310,14 @@ jobs:
- name: Waiting for Release
run: sleep 1800

- uses: actions/checkout@v4
- uses: actions/checkout@v4.1.3
with:
ref: main

- name: Setup Nushell
uses: hustcer/setup-nu@v3.9
uses: hustcer/setup-nu@v3.10
with:
version: 0.90.1
version: 0.92.2

# Keep the last a few releases
- name: Delete Older Releases
Expand Down
19 changes: 10 additions & 9 deletions .github/workflows/release-pkg.nu
Expand Up @@ -128,16 +128,16 @@ let executable = $'target/($target)/release/($bin)*($suffix)'
print $'Current executable file: ($executable)'

cd $src; mkdir $dist;
rm -rf $'target/($target)/release/*.d' $'target/($target)/release/nu_pretty_hex*'
rm -rf ...(glob $'target/($target)/release/*.d') ...(glob $'target/($target)/release/nu_pretty_hex*')
print $'(char nl)All executable files:'; hr-line
# We have to use `print` here to make sure the command output is displayed
print (ls -f $executable); sleep 1sec
print (ls -f ($executable | into glob)); sleep 1sec

print $'(char nl)Copying release files...'; hr-line
"To use Nu plugins, use the register command to tell Nu where to find the plugin. For example:
> register ./nu_plugin_query" | save $'($dist)/README.txt' -f
[LICENSE $executable] | each {|it| cp -rv $it $dist } | flatten
[LICENSE ...(glob $executable)] | each {|it| cp -rv $it $dist } | flatten

print $'(char nl)Check binary release version detail:'; hr-line
let ver = if $os == 'windows-latest' {
Expand All @@ -160,9 +160,9 @@ if $os in ['macos-latest'] or $USE_UBUNTU {
let archive = $'($dist)/($dest).tar.gz'

mkdir $dest
$files | each {|it| mv $it $dest } | ignore
$files | each {|it| cp -v $it $dest }

print $'(char nl)(ansi g)Archive contents:(ansi reset)'; hr-line; ls $dest
print $'(char nl)(ansi g)Archive contents:(ansi reset)'; hr-line; ls $dest | print

tar -czf $archive $dest
print $'archive: ---> ($archive)'; ls $archive
Expand All @@ -181,10 +181,11 @@ if $os in ['macos-latest'] or $USE_UBUNTU {
if (get-env _EXTRA_) == 'msi' {

let wixRelease = $'($src)/target/wix/($releaseStem).msi'
print $'(char nl)Start creating Windows msi package...'
print $'(char nl)Start creating Windows msi package with the following contents...'
cd $src; hr-line
# Wix need the binaries be stored in target/release/
cp -r $'($dist)/*' target/release/
cp -r ($'($dist)/*' | into glob) target/release/
ls target/release/* | print
cargo install cargo-wix --version 0.3.4
cargo wix --no-build --nocapture --package nu --output $wixRelease
# Workaround for https://github.com/softprops/action-gh-release/issues/280
Expand All @@ -194,9 +195,9 @@ if $os in ['macos-latest'] or $USE_UBUNTU {

} else {

print $'(char nl)(ansi g)Archive contents:(ansi reset)'; hr-line; ls
print $'(char nl)(ansi g)Archive contents:(ansi reset)'; hr-line; ls | print
let archive = $'($dist)/($releaseStem).zip'
7z a $archive *
7z a $archive ...(glob *)
let pkg = (ls -f $archive | get name)
if not ($pkg | is-empty) {
# Workaround for https://github.com/softprops/action-gh-release/issues/280
Expand Down

0 comments on commit 1433e9b

Please sign in to comment.