Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ jobs:
run: |
scripts/build.sh coverage
- uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
env:
CODECOV_WORKING_DIR: ${{ github.workspace }}
with:
root_dir: ${{ github.workspace }}
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
4 changes: 2 additions & 2 deletions Documentation/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ if want_docs != 'false'
'@INPUT@',
],
)
custom_target(
doc_tgts += custom_target(
adoc.underscorify() + '_man',
input: xml,
output: '@BASENAME@.1',
Expand Down Expand Up @@ -330,7 +330,7 @@ if want_docs != 'false'
output: adoc + '.hsubst',
configuration: substs,
)
custom_target(
doc_tgts += custom_target(
adoc.underscorify() + '_html',
input: subst,
output: '@BASENAME@.html',
Expand Down
4 changes: 2 additions & 2 deletions libnvme/doc/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ if want_docs != 'false'
c = run_command(list_man_pages, apif, check: true)
man_pages = c.stdout().split()
foreach page : man_pages
custom_target(
doc_tgts += custom_target(
page.underscorify() + '_man',
input: apif,
output: page + '.2',
Expand Down Expand Up @@ -94,7 +94,7 @@ if want_docs != 'false'
htmldir = join_paths(get_option('htmldir'), 'nvme')
sphinx_build = find_program('sphinx-build-3', 'sphinx-build')
if sphinx_build.found() and want_docs_build
custom_target(
doc_tgts += custom_target(
'generate_doc_html',
input: [static_sources, rst],
output: 'html',
Expand Down
1 change: 1 addition & 0 deletions libnvme/doc/rst/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ if want_docs != 'false'
install: true,
install_dir: rstdir,
)
doc_tgts += rst
endforeach
endif
else
Expand Down
13 changes: 13 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,8 @@ substs.set('VERSION_MAJOR', libnvme_so_version.split('.')[0])


################################################################################
doc_tgts = []

subdir('ccan') # declares: ccan_dep
subdir('libnvme') # declares: libnvme_dep

Expand Down Expand Up @@ -607,6 +609,17 @@ if want_nvme
subdir('Documentation')
endif

if doc_tgts.length() == 0
doc_tgts += custom_target(
'docs-dummy',
output: 'docs.stamp',
command: ['true'],
build_by_default: false,
)
endif

alias_target('docs', doc_tgts)


################################################################################
path_dict = {
Expand Down
55 changes: 49 additions & 6 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ usage() {
echo " coverage build coverage report"
echo " distro build libnvme and nvme-cli separately"
echo " docs build all documentation"
echo " man_docs build man documentation only"
echo " html_docs build html documentation only"
echo " rst_docs build rst documentation only"
echo " static build a static binary"
Expand Down Expand Up @@ -153,18 +154,22 @@ config_meson_coverage() {

config_meson_docs() {
CC="${CC}" "${MESON}" setup \
-Dnvme=disabled \
-Dlibnvme=disabled \
-Ddocs=all \
-Ddocs-build=true \
--prefix=/tmp/usr \
"${BUILDDIR}"
}

config_meson_man_docs() {
CC="${CC}" "${MESON}" setup \
-Ddocs=man \
-Ddocs-build=true \
--prefix=/tmp/usr \
"${BUILDDIR}"
}

config_meson_html_docs() {
CC="${CC}" "${MESON}" setup \
-Dnvme=disabled \
-Dlibnvme=disabled \
-Ddocs=html \
-Ddocs-build=true \
--prefix=/tmp/usr \
Expand All @@ -173,8 +178,6 @@ config_meson_html_docs() {

config_meson_rst_docs() {
CC="${CC}" "${MESON}" setup \
-Dnvme=disabled \
-Dlibnvme=disabled \
-Ddocs=rst \
-Ddocs-build=true \
--prefix=/tmp/usr \
Expand Down Expand Up @@ -252,6 +255,30 @@ build_meson() {
-C "${BUILDDIR}"
}

build_meson_docs() {
"${MESON}" compile \
-C "${BUILDDIR}" \
docs
}

build_meson_man_docs() {
"${MESON}" compile \
-C "${BUILDDIR}" \
docs
}

build_meson_html_docs() {
"${MESON}" compile \
-C "${BUILDDIR}" \
docs
}

build_meson_rst_docs() {
"${MESON}" compile \
-C "${BUILDDIR}" \
docs
}

test_meson() {
local args=(-C "${BUILDDIR}")

Expand All @@ -266,6 +293,22 @@ test_meson() {
"${MESON}" test "${args[@]}"
}

test_meson_docs() {
true
}

test_meson_man_docs() {
true
}

test_meson_html_docs() {
true
}

test_meson_rst_docs() {
true
}

test_meson_coverage() {
"${MESON}" test \
-C "${BUILDDIR}"
Expand Down
Loading