Skip to content

Commit

Permalink
feat: add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Its-Just-Nans committed Jan 25, 2024
1 parent d80f96d commit 4849542
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 8 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

# generate coverage report
cargo +stable install cargo-llvm-cov --locked
cargo llvm-cov --html

# generate documentation
cargo install comrak
mkdir -p dist
cp -r target/llvm-cov/html dist/coverage
sed 's|CHANGELOG.md|CHANGELOG.html|g' README.md >README.md.tmp
comrak --gfm -o dist/index.html --width 10 README.md.tmp
comrak --gfm -o dist/CHANGELOG.html --width 10 CHANGELOG.md
rm README.md.tmp
37 changes: 37 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Rust

on:
push:
branches: ["main"]

env:
CARGO_TERM_COLOR: always

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: true

jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build
run: cargo build --verbose
- name: Build website
run: .github/workflows/build.sh
- name: Upload coverage artifact
uses: actions/upload-artifact@v4.3.0
with:
path: "dist/"
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
9 changes: 1 addition & 8 deletions .github/workflows/rust.yml → .github/workflows/tests.yml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,11 @@ env:
CARGO_TERM_COLOR: always

jobs:
build:
tests:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
- name: Coverage
run: cargo +stable install cargo-llvm-cov --locked && cargo llvm-cov --html
- name: Upload coverage artifact
uses: actions/upload-artifact@v4.3.0
with:
path: "target/llvm-cov/html"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/target
.vscode/
dist/
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ notox --do my_path
| `-p`, `--json-pretty` | Output as JSON (prettified) |
| `-e`, `--json-error` | Output as JSON (only errors) |

## Infos

- [Changelog](CHANGELOG.md)
- [Coverage](https://its-just-nans.github.io/notox/coverage/)

## License

- [MIT](LICENSE)

0 comments on commit 4849542

Please sign in to comment.