ci(github): add documentation tests
This commit is contained in:
4
.github/workflows/test.yml
vendored
4
.github/workflows/test.yml
vendored
@@ -17,6 +17,10 @@ jobs:
|
|||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
toolchain: 1.76.0
|
toolchain: 1.76.0
|
||||||
|
- name: Run documentation tests
|
||||||
|
run: make test-doc
|
||||||
|
env:
|
||||||
|
MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY }}
|
||||||
- name: Run tests (with coverage)
|
- name: Run tests (with coverage)
|
||||||
run: make test-cover
|
run: make test-cover
|
||||||
env:
|
env:
|
||||||
|
|||||||
19
Makefile
19
Makefile
@@ -2,6 +2,17 @@ SHELL := /bin/bash
|
|||||||
|
|
||||||
.PHONY: test
|
.PHONY: test
|
||||||
|
|
||||||
|
define source_env_if_not_ci
|
||||||
|
@if [ -z "$${CI}" ]; then \
|
||||||
|
if [ -f ./.env ]; then \
|
||||||
|
source ./.env; \
|
||||||
|
else \
|
||||||
|
echo "No .env file found"; \
|
||||||
|
exit 1; \
|
||||||
|
fi \
|
||||||
|
fi
|
||||||
|
endef
|
||||||
|
|
||||||
define RELEASE_TEMPLATE
|
define RELEASE_TEMPLATE
|
||||||
conventional-changelog -p conventionalcommits -i ./CHANGELOG.md -s
|
conventional-changelog -p conventionalcommits -i ./CHANGELOG.md -s
|
||||||
git add .
|
git add .
|
||||||
@@ -21,8 +32,10 @@ release-major:
|
|||||||
$(call RELEASE_TEMPLATE,major)
|
$(call RELEASE_TEMPLATE,major)
|
||||||
|
|
||||||
test:
|
test:
|
||||||
@source ./.env && cargo test --all-targets --no-fail-fast
|
@$(source_env_if_not_ci) && cargo test --nocapture --no-fail-fast
|
||||||
test-cover:
|
test-cover:
|
||||||
cargo tarpaulin --all-targets --frozen --no-fail-fast --out Xml --skip-clean
|
@$(source_env_if_not_ci) && cargo tarpaulin --frozen --out Xml
|
||||||
|
test-doc:
|
||||||
|
@$(source_env_if_not_ci) && cargo test --doc --nocapture --no-fail-fast
|
||||||
test-watch:
|
test-watch:
|
||||||
cargo watch -x "test -- --all-targets --nocapture"
|
@$(source_env_if_not_ci) && cargo watch -x "test -- --nocapture"
|
||||||
|
|||||||
Reference in New Issue
Block a user