mirror of
https://github.com/lotabout/skim.git
synced 2026-09-10 07:16:23 -04:00
feat(ci): upload coverage report to pages for easier browsing (#1096)
* feat(ci): upload coverage report to pages for easier browsing * fix: remove anchors * fix: release report * fix: coverage percent * docs: update README * chore: only on master
This commit is contained in:
parent
e85cf6b708
commit
b56eed4125
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
|
|
@ -93,6 +93,8 @@ jobs:
|
|||
permissions:
|
||||
"code-quality": "write"
|
||||
"contents": "read"
|
||||
"id-token": "write"
|
||||
"pages": "write"
|
||||
|
||||
# Build and packages all the platform-specific things
|
||||
build-local-artifacts:
|
||||
|
|
|
|||
128
.github/workflows/test.yml
vendored
128
.github/workflows/test.yml
vendored
|
|
@ -19,9 +19,6 @@ concurrency:
|
|||
jobs:
|
||||
nextest:
|
||||
runs-on: ${{matrix.os}}
|
||||
permissions:
|
||||
contents: read
|
||||
code-quality: write
|
||||
strategy:
|
||||
matrix:
|
||||
build: [linux, macos, windows]
|
||||
|
|
@ -35,6 +32,9 @@ jobs:
|
|||
- build: windows
|
||||
os: windows-latest
|
||||
target: x86_64-pc-windows-msvc
|
||||
permissions:
|
||||
contents: read
|
||||
code-quality: write
|
||||
steps:
|
||||
- name: "[linux] Install dependencies"
|
||||
run: |
|
||||
|
|
@ -50,6 +50,7 @@ jobs:
|
|||
if: runner.os == 'macOS'
|
||||
env:
|
||||
HOMEBREW_NO_AUTO_UPDATE: 1
|
||||
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
|
|
@ -70,11 +71,24 @@ jobs:
|
|||
env-vars: "____"
|
||||
cache-on-failure: "true"
|
||||
cache-all-crates: "true"
|
||||
|
||||
- name: Run doctests
|
||||
run: cargo test --doc
|
||||
- name: Run tests
|
||||
- name: "[linux] Run tests with coverage"
|
||||
if: runner.os == 'Linux'
|
||||
# Do not use `--all-targets` to avoid running benches
|
||||
run: cargo llvm-cov nextest --release --profile ci --bins --lib --examples --tests --cobertura --output-path coverage.xml --failure-mode all
|
||||
run: |
|
||||
cargo llvm-cov nextest --release --profile ci --bins --lib --examples --tests --no-report
|
||||
cargo llvm-cov report --release --cobertura --output-path coverage.xml
|
||||
cargo llvm-cov report --release --html
|
||||
echo "COVERAGE_PERCENT=$(cargo llvm-cov report --release | tail -n1 | awk '{ print $4 }')" | tee --append $GITHUB_ENV
|
||||
env:
|
||||
LC_ALL: en_US.UTF-8
|
||||
TERM: xterm-256color
|
||||
- name: "[macos/windows] Run tests"
|
||||
if: runner.os != 'Linux'
|
||||
# Do not use `--all-targets` to avoid running benches
|
||||
run: cargo nextest run --release --profile ci --bins --lib --examples --tests
|
||||
env:
|
||||
LC_ALL: en_US.UTF-8
|
||||
TERM: xterm-256color
|
||||
|
|
@ -93,17 +107,58 @@ jobs:
|
|||
fi
|
||||
done
|
||||
shell: bash
|
||||
- name: Upload coverage report
|
||||
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
|
||||
# fail-on-error: false
|
||||
- name: "[linux] Upload coverage report"
|
||||
if: runner.os == 'Linux' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository)
|
||||
continue-on-error: true
|
||||
uses: actions/upload-code-coverage@v1
|
||||
with:
|
||||
file: coverage.xml
|
||||
language: Rust
|
||||
label: ${{ runner.os }}
|
||||
- name: "[linux] Generate coverage badge"
|
||||
if: &if-linux-master runner.os == 'Linux' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
|
||||
uses: emibcn/badge-action@v2.0.2
|
||||
with:
|
||||
label: 'Coverage'
|
||||
status: ${{ env.COVERAGE_PERCENT }}
|
||||
color: 'blue'
|
||||
path: 'target/llvm-cov/html/coverage.svg'
|
||||
- name: "[linux] Upload default branch results to gh pages"
|
||||
if: *if-linux-master
|
||||
uses: actions/upload-pages-artifact@v3
|
||||
with:
|
||||
path: target/llvm-cov/html
|
||||
|
||||
deploy-coverage-page:
|
||||
needs: nextest
|
||||
permissions:
|
||||
pages: write
|
||||
id-token: write
|
||||
environment:
|
||||
name: github-pages
|
||||
url: ${{ steps.deployment.outputs.page_url }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: "[linux] Deploy gh pages"
|
||||
id: deployment
|
||||
if: *if-linux-master
|
||||
uses: actions/deploy-pages@v4
|
||||
|
||||
clippy:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ${{matrix.os}}
|
||||
strategy:
|
||||
matrix:
|
||||
build: [linux, macos, windows]
|
||||
include:
|
||||
- build: linux
|
||||
os: ubuntu-latest
|
||||
target: x86_64-unknown-linux-musl
|
||||
- build: macos
|
||||
os: macos-latest
|
||||
target: x86_64-apple-darwin
|
||||
- build: windows
|
||||
os: windows-latest
|
||||
target: x86_64-pc-windows-msvc
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v6
|
||||
|
|
@ -117,7 +172,20 @@ jobs:
|
|||
run: cargo clippy
|
||||
|
||||
rustfmt:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ${{matrix.os}}
|
||||
strategy:
|
||||
matrix:
|
||||
build: [linux, macos, windows]
|
||||
include:
|
||||
- build: linux
|
||||
os: ubuntu-latest
|
||||
target: x86_64-unknown-linux-musl
|
||||
- build: macos
|
||||
os: macos-latest
|
||||
target: x86_64-apple-darwin
|
||||
- build: windows
|
||||
os: windows-latest
|
||||
target: x86_64-pc-windows-msvc
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v6
|
||||
|
|
@ -126,6 +194,33 @@ jobs:
|
|||
run: |
|
||||
cargo fmt --all -- --check
|
||||
|
||||
build-no-default-features:
|
||||
runs-on: ${{matrix.os}}
|
||||
strategy:
|
||||
matrix:
|
||||
build: [linux, macos, windows]
|
||||
include:
|
||||
- build: linux
|
||||
os: ubuntu-latest
|
||||
target: x86_64-unknown-linux-musl
|
||||
- build: macos
|
||||
os: macos-latest
|
||||
target: x86_64-apple-darwin
|
||||
- build: windows
|
||||
os: windows-latest
|
||||
target: x86_64-pc-windows-msvc
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v6
|
||||
- run: rustup toolchain install
|
||||
- name: Cache
|
||||
uses: Swatinem/rust-cache@v2
|
||||
with: *cache-with
|
||||
- name: Build without any feature
|
||||
run: |
|
||||
cargo build --no-default-features
|
||||
|
||||
|
||||
msrv:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
|
@ -139,16 +234,3 @@ jobs:
|
|||
tool: cargo-msrv@0.19
|
||||
- name: MSRV Verify
|
||||
run: cargo msrv verify
|
||||
|
||||
build-no-default-features:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v6
|
||||
- run: rustup toolchain install
|
||||
- name: Cache
|
||||
uses: Swatinem/rust-cache@v2
|
||||
with: *cache-with
|
||||
- name: Build without any feature
|
||||
run: |
|
||||
cargo build --no-default-features
|
||||
|
|
|
|||
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -36,4 +36,5 @@ __pycache__/
|
|||
.envrc.local
|
||||
/public
|
||||
|
||||
.codex
|
||||
.codex
|
||||
/coverage.xml
|
||||
|
|
|
|||
|
|
@ -5,6 +5,9 @@
|
|||
<a href="https://github.com/skim-rs/skim/actions?query=workflow%3A%22Build+%26+Test%22+event%3Apush">
|
||||
<img src="https://github.com/skim-rs/skim/actions/workflows/test.yml/badge.svg?event=push" alt="Build & Test" />
|
||||
</a>
|
||||
<a href="https://skim-rs.github.io/skim" >
|
||||
<img src="https://skim-rs.github.io/skim/coverage.svg" alt="coverage badge" />
|
||||
</a>
|
||||
<a href="https://repology.org/project/skim-fuzzy-finder/versions">
|
||||
<img src="https://repology.org/badge/tiny-repos/skim-fuzzy-finder.svg" alt="Packaging status" />
|
||||
</a>
|
||||
|
|
|
|||
|
|
@ -27,3 +27,5 @@ publish-prereleases = true
|
|||
[dist.github-custom-job-permissions.test]
|
||||
code-quality = "write"
|
||||
contents = "read"
|
||||
pages = "write"
|
||||
id-token = "write"
|
||||
|
|
|
|||
Loading…
Reference in a new issue