diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 05a76b72..1a19df90 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: CI +name: ci on: push: @@ -10,7 +10,7 @@ env: CARGO_TERM_COLOR: always jobs: - build: + test: runs-on: ubuntu-latest steps: @@ -54,3 +54,32 @@ jobs: - name: Run executable run: cargo run + + coverage: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Generate code coverage + run: | + make coverage + + - name: Upload coverage to codecov.io + uses: codecov/codecov-action@v4 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + + test-nix: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: cachix/install-nix-action@v30 + + - name: Run nix flake check + run: nix flake check --print-build-logs + + - name: Run nix build + run: nix build --print-build-logs diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml deleted file mode 100644 index 8d6c8f3b..00000000 --- a/.github/workflows/coverage.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Coverage - -on: - push: - branches: [master, release/*] - pull_request: - branches: [master, release/*] - -jobs: - test: - name: coverage - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Generate code coverage - run: | - make coverage - - - name: Upload coverage to codecov.io - uses: codecov/codecov-action@v4 - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/Cargo.lock b/Cargo.lock index f0c25954..b14a50ed 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -958,7 +958,7 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hl" -version = "0.30.1-alpha.2" +version = "0.30.1-alpha.3" dependencies = [ "bincode", "byte-strings", diff --git a/Cargo.toml b/Cargo.toml index 3ac80049..3579f529 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ members = [".", "crate/encstr"] [workspace.package] repository = "https://github.com/pamburus/hl" authors = ["Pavel Ivanov "] -version = "0.30.1-alpha.2" +version = "0.30.1-alpha.3" edition = "2021" license = "MIT" diff --git a/nix/package.nix b/nix/package.nix index 5e79dac1..745e483c 100644 --- a/nix/package.nix +++ b/nix/package.nix @@ -1,6 +1,8 @@ -{ lib -, rustPlatform -, +{ + lib, + stdenv, + rustPlatform, + installShellFiles, }: let cargoToml = builtins.fromTOML (builtins.readFile ../Cargo.toml); @@ -21,6 +23,19 @@ rustPlatform.buildRustPackage { }; }; + nativeBuildInputs = [ installShellFiles ]; + + postInstall = '' + installShellCompletion --cmd hl \ + --bash <($out/bin/hl --shell-completions bash) \ + --fish <($out/bin/hl --shell-completions fish) \ + --zsh <($out/bin/hl --shell-completions zsh) + $out/bin/hl --man-page >hl.1 + installManPage hl.1 + ''; + + doCheck = false; + meta = { description = cargoToml.package.description; homepage = cargoToml.workspace.package.repository;