Skip to content

Commit

Permalink
feat: update GitHub actions and fix code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
mattcarlotta committed Sep 18, 2024
1 parent 23ff946 commit a70dd47
Show file tree
Hide file tree
Showing 18 changed files with 225 additions and 461 deletions.
3 changes: 1 addition & 2 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ Feature requests should be opened using the feature request template.
Please complete the following information:
- Binary Version [e.g. 0.0.1]
- OS and Version: [e.g. Linux Mint 21.2]
- Compiler and Version [e.g. g++ v11.3.0+]

## Describe the bug
A clear and concise description of what the bug is.
Expand All @@ -24,7 +23,7 @@ A clear and concise description of what the bug is.
5. See error

## Debug logs
Run the binary with the `-de` or `--debug` flag and please provide any applicable debug logs.
Run the binary with the `--debug` flag and please provide any applicable debug logs.

## Expected behavior
A clear and concise description of what you expected to happen.
Expand Down
56 changes: 30 additions & 26 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: release
on:
push:
tags: ["v[0-9]+.[0-9]+.[0-9]+*"]
# branches: ["main"]
branches: ["main"]

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -16,38 +16,47 @@ jobs:
fail-fast: true
matrix:
toolchain:
- {runs_on: ubuntu-latest, name: "Linux x86_64", archive_name: "linux-x86_64", cpus: "$(nproc --all)"}
- {runs_on: macos-11, name: "macOS x86_64", archive_name: "macos-x86_64", cpus: "$(sysctl -n hw.ncpu)"}
- {runs_on: macos-14, name: "macOS AArch64", archive_name: "macos-aarch64", cpus: "$(sysctl -n hw.ncpu)"}
- {runs_on: ubuntu-latest, name: "Linux x86_64", archive_name: "linux-x86_64"}
- {runs_on: macos-11, name: "macOS x86_64", archive_name: "macos-x86_64"}
- {runs_on: macos-14, name: "macOS AArch64", archive_name: "macos-aarch64"}

steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
submodules: "recursive"
fetch-depth: 0
toolchain: stable
components: rustfmt, clippy

- name: install dependencies
if: ${{ matrix.toolchain.archive_name == 'linux-x86_64' }}
run: |
sudo apt-get -y update
sudo apt-get -y install libcurl4-openssl-dev
sudo apt-get -y install pandoc
- name: build
run: |
cmake -DCOMPILE_SRC=ON -DCOMPILE_TESTS=ON -DUSE_LOCALHOST_API=OFF .
cmake --build . -j ${{ matrix.toolchain.cpus }}
- name: install dependencies
if: ${{ matrix.toolchain.archive_name != 'linux-x86_64' }}
run: brew install pandoc

- name: format assets
run: cargo fmt --verbose --all --check

- name: lint assets
run: cargo clippy -- -Dwarnings

- name: test
- name: build assets
run: |
cd tests
./tests
cd ../
cargo build --release
cd docs
pandoc --standalone --to man nvi.1.md -o nvi.1
- name: compress
- name: run tests
run: cargo test

- name: compress assets
run: |
mkdir -p nvi/bin
mkdir -p nvi/man
cp ./src/nvi nvi/bin/
cp ./target/release/nvi nvi/bin/
cp ./docs/nvi.1 nvi/man/
tar -zcvf ./nvi-${{ matrix.toolchain.archive_name }}.tar.gz nvi
Expand All @@ -59,7 +68,7 @@ jobs:
retention-days: 1

publish:
if: github.event_name != 'pull_request'
# if: github.event_name != 'pull_request'
needs: build
runs-on: ubuntu-latest
env:
Expand All @@ -73,13 +82,8 @@ jobs:

- uses: actions/download-artifact@v4

- if: github.event_name == 'push'
run: |
TAG_NAME=${{ github.ref }}
echo "TAG_NAME=${TAG_NAME#refs/tags/}" >> $GITHUB_ENV
- name: set tag name
run: TAG_NAME=${{ github.ref }}

- name: publish release
env:
DEBUG: api
run: |
gh release create $TAG_NAME --generate-notes --title "$TAG_NAME" --target $GITHUB_SHA nvi-macos-x86_64/* nvi-macos-aarch64/* nvi-linux-x86_64/*
run: gh release create $TAG_NAME --generate-notes --title "$TAG_NAME" --target $GITHUB_SHA nvi-macos-x86_64/* nvi-macos-aarch64/* nvi-linux-x86_64/*
1 change: 1 addition & 0 deletions clippy.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
allow-private-module-inception = true
34 changes: 16 additions & 18 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,36 @@
# NVI Man Documentation

This documentation has been pre-built and exists [here](nvi.1).
Man documentation nvi CLI tool.

# Usage
## Requirements
- pandoc v3.1.6+ (click [here](https://pandoc.org/MANUAL.html) for documentation)

## Manually Build
```bash
git clone [email protected]:mattcarlotta/nvi.git
cd docs
pandoc --standalone --to man nvi.1.md -o nvi.1
```

Man from local directory:
```bash
man ./nvi.1
```

# System Installation
## System Installation

Locate directory paths that `man` searches within by running one of the commands below (directories are separated by colons `:`):

GNU/Linux:
GNU/LINUX (typically installed in `/usr/share/man`)
```bash
man --path
```
MAC OS:
Mac OS (typically installed in `/usr/local/share/man`)
```bash
cat /private/etc/manpaths
```

Select a directory path, add `man1` to the end of the path, and run the following command below (must be located within this `/docs` directory):

GNU/LINUX (typically installed in `/usr/share/man/man1`)
MAC OS (typically installed in `/usr/local/share/man/man1`)
Select a directory path, add `man1` to the end of the path, and then run the following command below (must be located within this `/docs` directory):
```bash
sudo cp nvi.1 <MANPATH_DIRECTORY/man1>
```
Expand All @@ -34,17 +40,9 @@ To view installed documentation:
man nvi
```

# Uninstallation
## System Uninstallation

```bash
sudo rm <MANPATH_DIRECTORY/man1>/nvi.1
```

# Build
### Requirements
- pandoc v3.1.6+ (click [here](https://pandoc.org/MANUAL.html) for documentation)

To manually generate the man documentation, run the following command:
```bash
pandoc --standalone --to man nvi.1.md -o nvi.1
```
Loading

0 comments on commit a70dd47

Please sign in to comment.