Skip to content

Commit

Permalink
Only open on macOS and not in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
theory committed Apr 5, 2024
1 parent a9abd91 commit 63af7e5
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
4 changes: 4 additions & 0 deletions .ci/test-cover
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,7 @@ grcov "${DESTDIR}" \
--output-types html,cobertura

xmllint --xpath "concat('Coverage: ', 100 * string(//coverage/@line-rate), '%')" "${DESTDIR}/cobertura.xml"

if [ "$(uname -o)" = "Darwin" ] && [ -z "$CI" ]; then
open "${DESTDIR}/html/index.html"
fi
2 changes: 0 additions & 2 deletions .github/workflows/lint-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ jobs:
run: sudo ./.ci/apt-install-postgres ${{ matrix.pg }}
- name: Setup Rust Cache
uses: Swatinem/rust-cache@v2
- name: Remove Data Diretory
run: rm -rf target/pgrx-test-*
- name: Install pgrx
run: cargo install cargo-pgrx --locked --version "$(make pgrx-version)"
- name: Initialize pgrx
Expand Down
18 changes: 12 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
PG_CONFIG ?= pg_config
PG_CONFIG ?= $(shell which pg_config)
PGRXV="$(shell perl -nE '/^pgrx\s+=\s"=?([^"]+)/ && do { say $$1; exit }' Cargo.toml)"
PGV=$(shell perl -E 'shift =~ /(\d+)/ && say $$1' "$(shell $(PG_CONFIG) --version)")

.PHONY: test # Run the full test suite
.DEFAULT_GOAL: package # Build jsonshcmea for the PostgreSQL cluster identified by pg_config.
package:
@cargo pgrx package --pg-config "$(PG_CONFIG)"

.PHONY: install # Install jsonschema into the PostgreSQL cluster identified by pg_config.
install:
@cargo pgrx install --release --pg-config "$(PG_CONFIG)"

.PHONY: test # Run the full test suite against the PostgreSQL version identified by pg_config.
test:
@cargo test --all --no-default-features --features "pg$(PGV) pg_test" -- --nocapture

.PHONY: cover # Run cover tests and generate and open a report.
.PHONY: cover # Run cover tests and generate & open a report.
cover:
@./.ci/test-cover "$(PGV)" "$(PGRXV)"
@open target/cover/html/index.html

.PHONY: pg-version # Print the current PGRX version from Cargo.toml
pgrx-version:
Expand All @@ -19,7 +26,6 @@ pgrx-version:
pg-version: Cargo.toml
@echo $(PGV)

## cleaan:
## cleaan: Remove build artifacts and intermediate files.
clean: target
@cargo clean
# $(RM) -rf $<

0 comments on commit 63af7e5

Please sign in to comment.