summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsitkevij <1553398+sitkevij@users.noreply.github.com>2023-10-01 10:19:38 -0700
committersitkevij <1553398+sitkevij@users.noreply.github.com>2023-10-01 10:19:38 -0700
commit6d07f194473714a40885386c442ab808fab30af3 (patch)
tree681d0e56659aede3b13073efa805bc1711627087
parent343352ad0445ec8522432df5795bbadfef41d9f0 (diff)
ci: latest gh actions, update ci build name, update docker build and readme
-rw-r--r--.github/workflows/ci.yml23
-rw-r--r--Dockerfile14
-rw-r--r--README.md9
3 files changed, 33 insertions, 13 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 3bbc1bc..d4a25aa 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -1,4 +1,4 @@
-name: CI
+name: ci
on:
pull_request:
branches:
@@ -33,8 +33,8 @@ jobs:
- { rust: beta, os: ubuntu-latest, experimental: true }
- { rust: nightly, os: ubuntu-latest, experimental: true }
steps:
- - uses: actions/checkout@v2
- - uses: hecrj/setup-rust-action@v1
+ - uses: actions/checkout@v4
+ - uses: hecrj/setup-rust-action@v2
with:
rust-version: ${{ matrix.rust }}
@@ -54,8 +54,8 @@ jobs:
env:
RUSTFLAGS: -Dwarnings
steps:
- - uses: actions/checkout@v2
- - uses: hecrj/setup-rust-action@v1
+ - uses: actions/checkout@v4
+ - uses: hecrj/setup-rust-action@v2
with:
components: clippy
- run: cargo clippy --workspace --all-targets --verbose
@@ -66,8 +66,17 @@ jobs:
name: Verify code formatting
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v2
- - uses: hecrj/setup-rust-action@v1
+ - uses: actions/checkout@v4
+ - uses: hecrj/setup-rust-action@v2
with:
components: rustfmt
- run: cargo fmt --all -- --check
+
+ codespell:
+ name: Verify code spelling
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - run: |
+ pip install codespell
+ codespell -L crate
diff --git a/Dockerfile b/Dockerfile
index b8697ac..3f55691 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,8 +1,8 @@
-FROM rust:alpine
+FROM rust:latest as builder
WORKDIR /root
-ENTRYPOINT ["target/release/hx"]
+ENTRYPOINT ["hx"]
LABEL org.label-schema.name="hx" \
- org.label-schema.description="Futuristic take on hexdump, made in rust" \
+ org.label-schema.description="Futuristic take on hexdump, made in Rust." \
org.label-schema.url="https://hub.docker.com/r/sitkevij/hx" \
org.label-schema.usage="https://github.com/sitkevij/hex/blob/master/README.md" \
org.label-schema.vcs-url="https://github.com/sitkevij/hex" \
@@ -11,4 +11,10 @@ LABEL org.label-schema.name="hx" \
maintainer="https://github.com/sitkevij"
ENV PATH=/root/.cargo/bin:$PATH
COPY . .
-RUN cargo build --release \ No newline at end of file
+RUN ls -lt
+RUN cargo install --path .
+
+FROM debian:bookworm-slim
+RUN apt-get update && rm -rf /var/lib/apt/lists/*
+COPY --from=builder /usr/local/cargo/bin/hx /usr/local/bin/hx
+ENTRYPOINT ["hx"]
diff --git a/README.md b/README.md
index 92beed2..7b16b87 100644
--- a/README.md
+++ b/README.md
@@ -33,8 +33,8 @@ cat tests/files/alphanumeric.txt | hx
bytes: 68
```
-[![build status](https://github.com/sitkevij/hex/workflows/CI/badge.svg)](https://github.com/sitkevij/hex/actions)
[![crates.io](https://img.shields.io/crates/v/hx.svg)](https://crates.io/crates/hx)
+[![build status](https://github.com/sitkevij/hex/workflows/ci/badge.svg)](https://github.com/sitkevij/hex/actions)
## quick links
@@ -128,7 +128,12 @@ guix shell --container hex
### docker run
```sh
-cat README.md | docker run -i sitkevij/hx:latest
+# stdin
+cat README.md | docker run -ti sitkevij/hx:latest
+
+# file input with parameters and NO_COLOR environment variable
+echo "NO_COLOR=1" >docker_env_vars.ignore.txt &&
+docker run -ti --env-file docker_env_vars.ignore.txt -v $(pwd)/README.md:/README.md sitkevij/hx:latest -fo -c8 /README.md
```
## features