Skip to content

Commit aeb11fd

Browse files
authored
Speed up make examples (#403)
The previous version was building the pgroll command before every example run. Instead, build the command once at the beginning and remove it at the end.
1 parent 080ca66 commit aeb11fd

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,7 @@ jobs:
158158
psql -h $POSTGRES_HOST -p $POSTGRES_PORT -U postgres -c "CREATE SCHEMA $PGROLL_SCHEMA;"
159159
fi
160160
161-
go run . init
162-
for file in ./examples/*.json; do
163-
if [ -f "$file" ]; then
164-
go run . start --complete $file;
165-
fi
166-
done
161+
make examples
167162
env:
168163
POSTGRES_PORT: 5432
169164
POSTGRES_HOST: localhost

Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@ lint:
1818
golangci-lint --config=.golangci.yml run
1919

2020
examples:
21-
@go run . init
21+
@go build
22+
@./pgroll init
2223
@for file in examples/*.json; do \
2324
if [ -f $$file ]; then \
24-
go run . start --complete $$file; \
25+
./pgroll start --complete $$file; \
2526
fi \
2627
done
28+
@go clean
2729

2830
test:
2931
go test ./...

0 commit comments

Comments
 (0)