From 7c51891550f84d705bb0fb9aec5fecd743e1c6a1 Mon Sep 17 00:00:00 2001 From: n4n5 Date: Thu, 25 Jan 2024 11:00:45 +0100 Subject: [PATCH] feat: add docs --- .github/workflows/build.sh | 14 +++++++++ .github/workflows/docs.yml | 37 +++++++++++++++++++++++ .github/workflows/{rust.yml => tests.yml} | 9 +----- .gitignore | 1 + README.md | 5 +++ 5 files changed, 58 insertions(+), 8 deletions(-) create mode 100755 .github/workflows/build.sh create mode 100644 .github/workflows/docs.yml rename .github/workflows/{rust.yml => tests.yml} (55%) mode change 100644 => 100755 diff --git a/.github/workflows/build.sh b/.github/workflows/build.sh new file mode 100755 index 0000000..a24f530 --- /dev/null +++ b/.github/workflows/build.sh @@ -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 diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..e213fe6 --- /dev/null +++ b/.github/workflows/docs.yml @@ -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 diff --git a/.github/workflows/rust.yml b/.github/workflows/tests.yml old mode 100644 new mode 100755 similarity index 55% rename from .github/workflows/rust.yml rename to .github/workflows/tests.yml index 8ec8eb8..aa8433a --- a/.github/workflows/rust.yml +++ b/.github/workflows/tests.yml @@ -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" diff --git a/.gitignore b/.gitignore index de358ff..e144fd9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /target .vscode/ +dist/ diff --git a/README.md b/README.md index 0149fe0..541bd36 100644 --- a/README.md +++ b/README.md @@ -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)