Skip to content

Commit

Permalink
Merge branch 'master' into add/rename/command
Browse files Browse the repository at this point in the history
  • Loading branch information
grv07 authored Feb 19, 2023
2 parents 9c711c8 + c5c1b5a commit 6907d14
Show file tree
Hide file tree
Showing 330 changed files with 19,673 additions and 5,883 deletions.
2 changes: 1 addition & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[alias]
xtask = "run --package xtask --"
integration-test = "test --features integration --workspace --test integration"
integration-test = "test --features integration --profile integration --workspace --test integration"
7 changes: 4 additions & 3 deletions .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ body:
id: helix-log
attributes:
label: Helix log
description: See `hx -h` for log file path
description: See `hx -h` for log file path. If you can reproduce the issue run `RUST_BACKTRACE=1 hx -vv` to generate a more detailed log file.
value: |
<details><summary>~/.cache/helix/helix.log</summary>
Expand Down Expand Up @@ -61,7 +61,8 @@ body:
label: Helix Version
description: >
Helix version (`hx -V` if using a release, `git describe` if building
from master)
placeholder: "helix 0.6.0 (c0dbd6dc)"
from master).
**Make sure that you are using the [latest helix release](https://github.com/helix-editor/helix/releases) or a newer master build**
placeholder: "helix 22.12 (5eaa6d97)"
validations:
required: true
89 changes: 19 additions & 70 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,27 @@ on:
push:
branches:
- master
merge_group:
schedule:
- cron: '00 01 * * *'

jobs:
check:
name: Check
name: Check (msrv)
runs-on: ubuntu-latest
strategy:
matrix:
rust: [stable, msrv]
steps:
- name: Checkout sources
uses: actions/checkout@v3

- name: Use MSRV rust toolchain
if: matrix.rust == 'msrv'
run: cp .github/workflows/msrv-rust-toolchain.toml rust-toolchain.toml

- name: Install stable toolchain
uses: helix-editor/rust-toolchain@v1
with:
profile: minimal
override: true

- uses: Swatinem/rust-cache@v1
- uses: Swatinem/rust-cache@v2

- name: Run cargo check
uses: actions-rs/cargo@v1
with:
command: check
run: cargo check

test:
name: Test Suite
Expand All @@ -46,12 +37,9 @@ jobs:
uses: actions/checkout@v3

- name: Install stable toolchain
uses: helix-editor/rust-toolchain@v1
with:
profile: minimal
override: true
uses: dtolnay/rust-toolchain@1.63

- uses: Swatinem/rust-cache@v1
- uses: Swatinem/rust-cache@v2

- name: Cache test tree-sitter grammar
uses: actions/cache@v3
Expand All @@ -61,15 +49,10 @@ jobs:
restore-keys: ${{ runner.os }}-stable-v${{ env.CACHE_VERSION }}-tree-sitter-grammars-

- name: Run cargo test
uses: actions-rs/cargo@v1
with:
command: test
args: --workspace
run: cargo test --workspace

- name: Run cargo integration-test
uses: actions-rs/cargo@v1
with:
command: integration-test
run: cargo integration-test

strategy:
matrix:
Expand All @@ -83,31 +66,20 @@ jobs:
uses: actions/checkout@v3

- name: Install stable toolchain
uses: helix-editor/rust-toolchain@v1
uses: dtolnay/rust-toolchain@1.63
with:
profile: minimal
override: true
components: rustfmt, clippy

- uses: Swatinem/rust-cache@v1
- uses: Swatinem/rust-cache@v2

- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
run: cargo fmt --all --check

- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-targets -- -D warnings
run: cargo clippy --workspace --all-targets -- -D warnings

- name: Run cargo doc
uses: actions-rs/cargo@v1
with:
command: doc
args: --no-deps --workspace --document-private-items
run: cargo doc --no-deps --workspace --document-private-items
env:
RUSTDOCFLAGS: -D warnings

Expand All @@ -119,18 +91,15 @@ jobs:
uses: actions/checkout@v3

- name: Install stable toolchain
uses: helix-editor/rust-toolchain@v1
with:
profile: minimal
override: true
uses: dtolnay/rust-toolchain@1.63

- uses: Swatinem/rust-cache@v2

- uses: Swatinem/rust-cache@v1
- name: Validate queries
run: cargo xtask query-check

- name: Generate docs
uses: actions-rs/cargo@v1
with:
command: xtask
args: docgen
run: cargo xtask docgen

- name: Check uncommitted documentation changes
run: |
Expand All @@ -139,23 +108,3 @@ jobs:
|| (echo "Run 'cargo xtask docgen', commit the changes and push again" \
&& exit 1)
queries:
name: Tree-sitter queries
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3

- name: Install stable toolchain
uses: helix-editor/rust-toolchain@v1
with:
profile: minimal
override: true

- uses: Swatinem/rust-cache@v1

- name: Generate docs
uses: actions-rs/cargo@v1
with:
command: xtask
args: query-check
4 changes: 2 additions & 2 deletions .github/workflows/cachix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
uses: actions/checkout@v3

- name: Install nix
uses: cachix/install-nix-action@v18
uses: cachix/install-nix-action@v19

- name: Authenticate with Cachix
uses: cachix/cachix-action@v11
uses: cachix/cachix-action@v12
with:
name: helix
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/languages.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ indent = { tab-width = 4, unit = " " }

[[grammar]]
name = "rust"
source = { git = "https://github.com/tree-sitter/tree-sitter-rust", rev = "a360da0a29a19c281d08295a35ecd0544d2da211" }
source = { git = "https://github.com/tree-sitter/tree-sitter-rust", rev = "0431a2c60828731f27491ee9fdefe25e250ce9c9" }

[[language]]
name = "nix"
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/msrv-rust-toolchain.toml

This file was deleted.

73 changes: 33 additions & 40 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,12 @@ jobs:
uses: actions/checkout@v3

- name: Install stable toolchain
uses: helix-editor/rust-toolchain@v1
with:
profile: minimal
override: true
uses: dtolnay/rust-toolchain@stable

- uses: Swatinem/rust-cache@v1
- uses: Swatinem/rust-cache@v2

- name: Fetch tree-sitter grammars
uses: actions-rs/cargo@v1
with:
command: run
args: --package=helix-loader --bin=hx-loader
run: cargo run --package=helix-loader --bin=hx-loader

- name: Bundle grammars
run: tar cJf grammars.tar.xz -C runtime/grammars/sources .
Expand All @@ -50,24 +44,34 @@ jobs:
dist:
name: Dist
needs: [fetch-grammars]
env:
# For some builds, we use cross to test on 32-bit and big-endian
# systems.
CARGO: cargo
# When CARGO is set to CROSS, this is set to `--target matrix.target`.
TARGET_FLAGS:
# When CARGO is set to CROSS, TARGET_DIR includes matrix.target.
TARGET_DIR: ./target
# Emit backtraces on panics.
RUST_BACKTRACE: 1
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false # don't fail other jobs if one fails
matrix:
build: [x86_64-linux, x86_64-macos, x86_64-windows] #, x86_64-win-gnu, win32-msvc
include:
- build: x86_64-linux
os: ubuntu-20.04
os: ubuntu-latest
rust: stable
target: x86_64-unknown-linux-gnu
cross: false
- build: aarch64-linux
os: ubuntu-20.04
os: ubuntu-latest
rust: stable
target: aarch64-unknown-linux-gnu
cross: true
- build: riscv64-linux
os: ubuntu-20.04
os: ubuntu-latest
rust: stable
target: riscv64gc-unknown-linux-gnu
cross: true
Expand All @@ -77,7 +81,7 @@ jobs:
target: x86_64-apple-darwin
cross: false
- build: x86_64-windows
os: windows-2019
os: windows-latest
rust: stable
target: x86_64-pc-windows-msvc
cross: false
Expand Down Expand Up @@ -110,28 +114,31 @@ jobs:
tar xJf grammars/grammars.tar.xz -C runtime/grammars/sources
- name: Install ${{ matrix.rust }} toolchain
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
profile: minimal
toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }}
override: true

# Install a pre-release version of Cross
# TODO: We need to pre-install Cross because we need cross-rs/cross#591 to
# get a newer C++ compiler toolchain. Remove this step when Cross
# 0.3.0, which includes cross-rs/cross#591, is released.
- name: Install Cross
if: "matrix.cross"
run: cargo install cross --git https://github.com/cross-rs/cross.git --rev 47df5c76e7cba682823a0b6aa6d95c17b31ba63a
run: |
cargo install cross --git https://github.com/cross-rs/cross.git --rev 47df5c76e7cba682823a0b6aa6d95c17b31ba63a
echo "CARGO=cross" >> $GITHUB_ENV
# echo "TARGET_FLAGS=--target ${{ matrix.target }}" >> $GITHUB_ENV
# echo "TARGET_DIR=./target/${{ matrix.target }}" >> $GITHUB_ENV

- name: Show command used for Cargo
run: |
echo "cargo command is: ${{ env.CARGO }}"
echo "target flag is: ${{ env.TARGET_FLAGS }}"
- name: Run cargo test
uses: actions-rs/cargo@v1
if: "!matrix.skip_tests"
with:
use-cross: ${{ matrix.cross }}
command: test
args: --release --locked --target ${{ matrix.target }} --workspace
run: ${{ env.CARGO }} test --release --locked --target ${{ matrix.target }} --workspace

- name: Set profile.release.strip = true
shell: bash
Expand All @@ -142,11 +149,7 @@ jobs:
EOF
- name: Build release binary
uses: actions-rs/cargo@v1
with:
use-cross: ${{ matrix.cross }}
command: build
args: --release --locked --target ${{ matrix.target }}
run: ${{ env.CARGO }} build --release --locked --target ${{ matrix.target }}

- name: Build AppImage
shell: bash
Expand Down Expand Up @@ -221,16 +224,6 @@ jobs:

- uses: actions/download-artifact@v3

- name: Calculate tag name
run: |
name=dev
if [[ $GITHUB_REF == refs/tags/* ]]; then
name=${GITHUB_REF:10}
fi
echo ::set-output name=val::$name
echo TAG=$name >> $GITHUB_ENV
id: tagname

- name: Build archive
shell: bash
run: |
Expand All @@ -250,7 +243,7 @@ jobs:
if [[ $platform =~ "windows" ]]; then
exe=".exe"
fi
pkgname=helix-$TAG-$platform
pkgname=helix-$GITHUB_REF_NAME-$platform
mkdir $pkgname
cp $source/LICENSE $source/README.md $pkgname
mkdir $pkgname/contrib
Expand All @@ -270,7 +263,7 @@ jobs:
fi
done
tar cJf dist/helix-$TAG-source.tar.xz -C $source .
tar cJf dist/helix-$GITHUB_REF_NAME-source.tar.xz -C $source .
mv dist $source/
- name: Upload binaries to release
Expand All @@ -280,7 +273,7 @@ jobs:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/*
file_glob: true
tag: ${{ steps.tagname.outputs.val }}
tag: ${{ github.ref_name }}
overwrite: true

- name: Upload binaries as artifact
Expand Down
Loading

0 comments on commit 6907d14

Please sign in to comment.