diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index ccfabb84..3e6fcb1d 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -81,9 +81,17 @@ jobs: - name: Run the frontend tests run: make frontend-test + - name: Run migrations + run: make migrate + env: + DATABASE_URL: postgres://postgres:password@localhost:5432/postgres + - name: Generate coverage file if: matrix.version == '1.51.0' && (github.ref == 'refs/heads/master' || github.event_name == 'pull_request') - run: make xml-test-coverage + uses: actions-rs/tarpaulin@v0.1 + with: + version: '0.15.0' + args: '-t 1200' env: DATABASE_URL: postgres://postgres:password@localhost:5432/postgres # GIT_HASH is dummy value. I guess build.rs is skipped in tarpaulin diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index e97cae64..f7a0f1ef 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -69,7 +69,7 @@ jobs: run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh - name: Run migrations - run: make migrations + run: make migrate env: DATABASE_URL: postgres://postgres:password@localhost:5432/postgres diff --git a/Makefile b/Makefile index 8933501f..983fb4b6 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,7 @@ frontend: yarn install yarn build -test: migrations +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 @@ -34,11 +34,11 @@ a: b: ${MAKE} a -xml-test-coverage: migrations +xml-test-coverage: migrate cd browser && cargo tarpaulin -t 1200 --out Xml cargo tarpaulin -t 1200 --out Xml -coverage: migrations +coverage: migrate cd browser && cargo tarpaulin -t 1200 --out Html cargo tarpaulin -t 1200 --out Html @@ -56,7 +56,7 @@ docker-publish: docker-build docker push mcaptcha/mcaptcha:master docker push mcaptcha/mcaptcha:latest -migrations: +migrate: cargo run --bin tests-migrate help: @@ -68,7 +68,7 @@ help: @echo ' doc - build documentation' @echo ' frontend - build static assets in prod mode' @echo ' frontend-test - run frontend tests' - @echo ' migrations - run database migrations' + @echo ' migrate - run database migrations' @echo ' run - run developer instance' @echo ' test - run unit and integration tests' @echo ' xml-coverage - build test coverage in XML for upload to codecov'