mirror of
https://github.com/Magnus167/rustframe.git
synced 2025-08-20 04:19:59 +00:00
68 lines
1.5 KiB
YAML
68 lines
1.5 KiB
YAML
name: docs-and-testcov
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
permissions:
|
|
contents: read
|
|
id-token: write
|
|
pages: write
|
|
|
|
jobs:
|
|
docs-and-testcov:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Rust
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: stable
|
|
override: true
|
|
|
|
|
|
- name: Build documentation
|
|
run: cargo doc --no-deps
|
|
|
|
- name: Prepare documentation for Pages
|
|
run: |
|
|
|
|
|
|
- name: Install Cargo binstall
|
|
uses: cargo-bins/cargo-binstall@main
|
|
|
|
- name: Install cargo-tarpaulin via binstall
|
|
run: cargo binstall cargo-tarpaulin --no-confirm --locked
|
|
|
|
- name: Generate coverage report
|
|
run: |
|
|
mkdir -p testcov
|
|
cargo tarpaulin --out Html
|
|
|
|
- name: Check for tarpaulin-report.html
|
|
run: |
|
|
if [ ! -f tarpaulin-report.html ]; then
|
|
echo "tarpaulin-report.html not found!"
|
|
exit 1
|
|
fi
|
|
|
|
- name: Copy files to output directory
|
|
run: |
|
|
mkdir output
|
|
cp tarpaulin-report.html target/doc/rustframe/
|
|
# cp -r target/doc/rustframe/* output/
|
|
|
|
- name: Upload Pages artifact
|
|
# if: github.event_name == 'push'
|
|
uses: actions/upload-pages-artifact@v3
|
|
with:
|
|
path: target/doc/
|
|
|
|
- name: Deploy to GitHub Pages
|
|
# if: github.event_name == 'push'
|
|
uses: actions/deploy-pages@v4
|