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 }} |         stack: ${{ matrix.plan.stack }} | ||||||
|       run: | |       run: | | ||||||
|         export PATH=~/.local/bin:$PATH |         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 |     - name: Test haddock generation | ||||||
|       env: |       env: | ||||||
|  | |||||||
							
								
								
									
										2
									
								
								.github/workflows/mac.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/workflows/mac.yml
									
									
									
									
										vendored
									
									
								
							| @ -158,7 +158,7 @@ jobs: | |||||||
|         stack: ${{ matrix.plan.stack }} |         stack: ${{ matrix.plan.stack }} | ||||||
|       run: | |       run: | | ||||||
|         export PATH=~/.local/bin:$PATH |         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: |     # artifacts: | ||||||
| 
 | 
 | ||||||
|  | |||||||
							
								
								
									
										2
									
								
								.github/workflows/push.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/workflows/push.yml
									
									
									
									
										vendored
									
									
								
							| @ -151,4 +151,4 @@ jobs: | |||||||
|         stack: ${{ matrix.plan.stack }} |         stack: ${{ matrix.plan.stack }} | ||||||
|       run: | |       run: | | ||||||
|         export PATH=~/.local/bin:$PATH |         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 |     # run hledger-lib/hledger functional tests, skipping the ones for addons | ||||||
|     ## - export PATH=~/.local/bin:$PATH |     ## - 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: |     # 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 \ | functest: hledger/test/addons/hledger-addon \ | ||||||
| 	$(call def-help,functest, build hledger quickly and run the functional tests (and some unit tests) ) | 	$(call def-help,functest, build hledger quickly and run the functional tests (and some unit tests) ) | ||||||
| 	@$(STACK) build --fast hledger | 	@$(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) | 		&& echo $@ PASSED) || (echo $@ FAILED; false) | ||||||
| 
 | 
 | ||||||
| functest-%: hledger/test/addons/hledger-addon \ | functest-%: hledger/test/addons/hledger-addon \ | ||||||
|  | |||||||
| @ -1,9 +1,15 @@ | |||||||
| #!/bin/sh | #!/bin/sh | ||||||
| # Run this script (or "make addons") to compile all addons in this directory. | # Compile all add-on scrips in this directory. | ||||||
| cd "$(dirname "$0")" | 
 | ||||||
| echo "building dependencies" | cd "$(dirname "$0")" || exit | ||||||
|  | 
 | ||||||
|  | echo "building hledger libraries" | ||||||
| stack build hledger | stack build hledger | ||||||
| # additional deps needed by addons | 
 | ||||||
| stack install Diff here #Chart Chart-diagrams colour  | echo "installing extra libraries needed by scripts" | ||||||
| echo "building add-on commands" | stack install string-qq | ||||||
| for f in hledger-*.hs; do stack ghc -- -Wall -Werror $f; done | 
 | ||||||
|  | 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