ci: also test compilation of bin/ add-on scripts
This commit is contained in:
		
							parent
							
								
									88ccd87c47
								
							
						
					
					
						commit
						06b466d847
					
				
							
								
								
									
										2
									
								
								.github/workflows/linux.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/workflows/linux.yml
									
									
									
									
										vendored
									
									
								
							| @ -214,7 +214,7 @@ jobs: | ||||
|         stack: ${{ matrix.plan.stack }} | ||||
|       run: | | ||||
|         export PATH=~/.local/bin:$PATH | ||||
|         COLUMNS=80 $stack exec -- shelltest --execdir -j16 hledger/test -x /_ -x /bin -x /addons | ||||
|         COLUMNS=80 $stack exec -- shelltest --execdir -j16 hledger/test -x /_ -x /addons | ||||
| 
 | ||||
|     - name: Test haddock generation | ||||
|       env: | ||||
|  | ||||
							
								
								
									
										2
									
								
								.github/workflows/mac.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/workflows/mac.yml
									
									
									
									
										vendored
									
									
								
							| @ -158,7 +158,7 @@ jobs: | ||||
|         stack: ${{ matrix.plan.stack }} | ||||
|       run: | | ||||
|         export PATH=~/.local/bin:$PATH | ||||
|         COLUMNS=80 $stack exec -- shelltest --execdir -j16 hledger/test -x /_ -x /bin -x /addons | ||||
|         COLUMNS=80 $stack exec -- shelltest --execdir -j16 hledger/test -x /_ -x /addons | ||||
| 
 | ||||
|     # artifacts: | ||||
| 
 | ||||
|  | ||||
							
								
								
									
										2
									
								
								.github/workflows/push.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/workflows/push.yml
									
									
									
									
										vendored
									
									
								
							| @ -151,4 +151,4 @@ jobs: | ||||
|         stack: ${{ matrix.plan.stack }} | ||||
|       run: | | ||||
|         export PATH=~/.local/bin:$PATH | ||||
|         COLUMNS=80 $stack exec -- shelltest --execdir -j16 hledger/test -x /_ -x /bin -x /addons | ||||
|         COLUMNS=80 $stack exec -- shelltest --execdir -j16 hledger/test -x /_ -x /addons | ||||
|  | ||||
							
								
								
									
										2
									
								
								.github/workflows/windows.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/workflows/windows.yml
									
									
									
									
										vendored
									
									
								
							| @ -161,7 +161,7 @@ jobs: | ||||
| 
 | ||||
|     # run hledger-lib/hledger functional tests, skipping the ones for addons | ||||
|     ## - export PATH=~/.local/bin:$PATH | ||||
|     #- COLUMNS=80 stack exec -- shelltest --execdir -j16 hledger/test -x /_ -x /bin -x /addons | ||||
|     #- COLUMNS=80 stack exec -- shelltest --execdir -j16 hledger/test -x /_ -x /addons | ||||
| 
 | ||||
|     # artifacts: | ||||
| 
 | ||||
|  | ||||
							
								
								
									
										2
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								Makefile
									
									
									
									
									
								
							| @ -494,7 +494,7 @@ builtintest: $(call def-help,builtintest, run hledgers built in test command) | ||||
| functest: hledger/test/addons/hledger-addon \ | ||||
| 	$(call def-help,functest, build hledger quickly and run the functional tests (and some unit tests) ) | ||||
| 	@$(STACK) build --fast hledger | ||||
| 	@($(SHELLTESTSTK) -w `$(STACK) exec -- which hledger` hledger/test/ \
 | ||||
| 	@($(SHELLTESTSTK) -w `$(STACK) exec -- which hledger` hledger/test/ bin/ \
 | ||||
| 		&& echo $@ PASSED) || (echo $@ FAILED; false) | ||||
| 
 | ||||
| functest-%: hledger/test/addons/hledger-addon \ | ||||
|  | ||||
| @ -1,9 +1,15 @@ | ||||
| #!/bin/sh | ||||
| # Run this script (or "make addons") to compile all addons in this directory. | ||||
| cd "$(dirname "$0")" | ||||
| echo "building dependencies" | ||||
| # Compile all add-on scrips in this directory. | ||||
| 
 | ||||
| cd "$(dirname "$0")" || exit | ||||
| 
 | ||||
| echo "building hledger libraries" | ||||
| stack build hledger | ||||
| # additional deps needed by addons | ||||
| stack install Diff here #Chart Chart-diagrams colour  | ||||
| echo "building add-on commands" | ||||
| for f in hledger-*.hs; do stack ghc -- -Wall -Werror $f; done | ||||
| 
 | ||||
| echo "installing extra libraries needed by scripts" | ||||
| stack install string-qq | ||||
| 
 | ||||
| echo "compiling hledger-* scripts" | ||||
| for f in hledger-*.hs; do stack ghc -- "$f"; done | ||||
|   # stack script --compile would install extra libs more automatically | ||||
|   # but would also run scripts, which we don't want | ||||
|  | ||||
							
								
								
									
										12
									
								
								bin/scripts.test
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								bin/scripts.test
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,12 @@ | ||||
| # Functional tests for the add-on scripts in this directory. | ||||
| 
 | ||||
| # Check that they all (or at least these ones) still compile with this version of hledger. | ||||
| # stdout and exit code are ignored for cleaner failure output. | ||||
| # $ ./compile.sh >/dev/null | ||||
| $  stack ghc -- hledger-balance-as-budget.hs     >/dev/null || true | ||||
| $  stack ghc -- hledger-check-fancyassertions.hs >/dev/null || true | ||||
| $  stack ghc -- hledger-check-tagfiles.hs        >/dev/null || true | ||||
| $  stack ghc -- hledger-combine-balances.hs      >/dev/null || true | ||||
| $  stack ghc --package string-qq -- hledger-print-location.hs >/dev/null || true | ||||
| $  stack ghc --package string-qq -- hledger-smooth.hs         >/dev/null || true | ||||
| $  stack ghc --package string-qq -- hledger-swap-dates.hs     >/dev/null || true | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user