makeifle: clean and test workflows

This commit is contained in:
realaravinth 2021-07-07 21:10:15 +05:30
parent eb5c0164dc
commit 2e50c263a8
No known key found for this signature in database
GPG key ID: AD9F0F08E855ED88
4 changed files with 42 additions and 39 deletions

View file

@ -86,6 +86,9 @@ jobs:
env:
DATABASE_URL: postgres://postgres:password@localhost:5432/postgres
- name: build frontend
run: make frontend
- name: Generate coverage file
if: matrix.version == '1.51.0' && (github.ref == 'refs/heads/master' || github.event_name == 'pull_request')
uses: actions-rs/tarpaulin@v0.1

View file

@ -78,6 +78,9 @@ jobs:
env:
DATABASE_URL: postgres://postgres:password@localhost:5432/postgres
- name: build frontend
run: make frontend
- name: run tests
run: make test
env:

2
Cargo.lock generated
View file

@ -579,7 +579,7 @@ dependencies = [
[[package]]
name = "cache-buster"
version = "0.2.0"
source = "git+https://github.com/realaravinth/cache-buster#3cf8828ab80b72037d23f5ce12b5879e44534da3"
source = "git+https://github.com/realaravinth/cache-buster#8e630d8e4574e2f42d616e4daba425ba33859e59"
dependencies = [
"data-encoding",
"derive_builder",

View file

@ -1,8 +1,14 @@
default: frontend
cargo build
run: frontend
cargo run
clean:
cargo clean
rm ./src/cache_buster_data.json || true
rm -rf ./static/cache/bundle || true
coverage: migrate
cd browser && cargo tarpaulin -t 1200 --out Html
cargo tarpaulin -t 1200 --out Html
dev-env:
cargo fetch
@ -13,42 +19,6 @@ doc:
cargo doc --no-deps --workspace --all-features
cd browser && cargo doc --no-deps --workspace --all-features
frontend:
cd browser && wasm-pack build --release
yarn install
yarn build
test: migrate
cd browser && wasm-pack test --release --headless --chrome
cd browser && wasm-pack test --release --headless --firefox
cargo test --all --all-features --no-fail-fast
${MAKE} frontend-test
frontend-test:
cd browser && wasm-pack test --release --headless --chrome
cd browser && wasm-pack test --release --headless --firefox
yarn test
a:
echo a
b:
${MAKE} a
xml-test-coverage: migrate
cd browser && cargo tarpaulin -t 1200 --out Xml
cargo tarpaulin -t 1200 --out Xml
coverage: migrate
cd browser && cargo tarpaulin -t 1200 --out Html
cargo tarpaulin -t 1200 --out Html
release: frontend
cargo build --release
clean:
cargo clean
yarn clean
docker-build:
docker build -t mcaptcha/mcaptcha:master -t mcaptcha/mcaptcha:latest .
@ -56,9 +26,36 @@ docker-publish: docker-build
docker push mcaptcha/mcaptcha:master
docker push mcaptcha/mcaptcha:latest
frontend:
cd browser && wasm-pack build --release
yarn install
yarn build
frontend-test:
cd browser && wasm-pack test --release --headless --chrome
cd browser && wasm-pack test --release --headless --firefox
yarn test
migrate:
cargo run --bin tests-migrate
release: frontend
cargo build --release
run: frontend
cargo run
test: migrate
cd browser && wasm-pack test --release --headless --chrome
cd browser && wasm-pack test --release --headless --firefox
${MAKE} frontend-test
${MAKE} frontend
cargo test --all --all-features --no-fail-fast
xml-test-coverage: migrate
cd browser && cargo tarpaulin -t 1200 --out Xml
cargo tarpaulin -t 1200 --out Xml
help:
@echo ' clean - drop builds and environments'
@echo ' coverage - build test coverage in HTML format'