ci: github: tweaks
This commit is contained in:
		
							parent
							
								
									bba0c0121d
								
							
						
					
					
						commit
						71f3f8295a
					
				
							
								
								
									
										81
									
								
								.github/workflows/ci.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										81
									
								
								.github/workflows/ci.yml
									
									
									
									
										vendored
									
									
								
							| @ -10,6 +10,7 @@ | ||||
| # https://help.github.com/en/actions/configuring-and-managing-workflows/caching-dependencies-to-speed-up-workflows | ||||
| # https://github.com/sdras/awesome-actions | ||||
| # http://www.btellez.com/posts/triggering-github-actions-with-webhooks.html | ||||
| # https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners#supported-runners-and-hardware-resources | ||||
| 
 | ||||
| name: hledger CI | ||||
| 
 | ||||
| @ -49,9 +50,7 @@ jobs: | ||||
|   build: | ||||
|     strategy: | ||||
|       matrix: | ||||
|         # os runners: https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners#supported-runners-and-hardware-resources | ||||
|         os: [ubuntu-latest, macos-latest, windows-latest] | ||||
|         # use this to specify what resolvers and ghc to use | ||||
|         plan: | ||||
|         # - { build: stack, resolver: "--resolver lts-9"  }    # ghc-8.0.2 | ||||
|         # - { build: stack, resolver: "--resolver lts-11"  }   # ghc-8.2.2 | ||||
| @ -67,12 +66,11 @@ jobs: | ||||
|         # - { build: cabal, ghc: 8.6.5, cabal-install: "2.4"  } | ||||
|         # - { build: cabal, ghc: 8.8.1, cabal-install: "2.4"  }   # currently not working for >= 3.0 | ||||
|         # use this to include any dependencies from OS package managers | ||||
|         include: [] | ||||
|         # include: [] | ||||
|         # - os: macos-latest | ||||
|         #   brew: anybrewdeps | ||||
|         # - os: ubuntu-latest | ||||
|         #   apt-get: happy libblas-dev liblapack-dev | ||||
| 
 | ||||
|         # exclude: | ||||
|         # - os: macos-latest | ||||
|         #   plan: | ||||
| @ -82,15 +80,15 @@ jobs: | ||||
| 
 | ||||
|     steps: | ||||
| 
 | ||||
|     # cache these directories | ||||
|     - uses: actions/cache@v1 | ||||
|       name: Cache ~/.stack | ||||
|     # cache these dirs | ||||
|     - name: Cache ~/.stack | ||||
|       uses: actions/cache@v1           # https://github.com/marketplace/actions/cache | ||||
|       with: | ||||
|         path: ~/.stack | ||||
|         key: ${{ runner.os }}-stack | ||||
|         #key: ${{ runner.os }}-${{ matrix.resolver }}-stack | ||||
|     - uses: actions/cache@v1           # https://github.com/marketplace/actions/cache | ||||
|       name: Cache ~/.local/bin | ||||
|     - name: Cache ~/.local/bin | ||||
|       uses: actions/cache@v1 | ||||
|       with: | ||||
|         path: ~/.local/bin | ||||
|         key: ${{ runner.os }}-local-bin | ||||
| @ -112,73 +110,16 @@ jobs: | ||||
|         7z x stack.zip stack.exe | ||||
|         ./stack --version | ||||
| 
 | ||||
|     # install cabal | ||||
|     # - name: Setup cabal-install | ||||
|     #   uses: actions/setup-haskell@v1 | ||||
|     #   with: | ||||
|     #     ghc-version: ${{ matrix.plan.ghc }} | ||||
|     #     cabal-version: ${{ matrix.plan.cabal-install }} | ||||
|     #   if: matrix.plan.build == 'cabal' | ||||
| 
 | ||||
|     # - name: Install OS packages | ||||
|     #   uses: mstksg/get-package@v1   # https://github.com/marketplace/actions/get-package | ||||
|     #   with: | ||||
|     #     apt-get: ${{ matrix.apt-get }} | ||||
|     #     brew: ${{ matrix.brew }} | ||||
| 
 | ||||
|     - name: Install haskell dependencies | ||||
|       run: | | ||||
|         set -ex | ||||
|         case "$BUILD" in | ||||
|           stack) | ||||
|             stack --no-terminal --install-ghc $ARGS test --bench --only-dependencies | ||||
|             ;; | ||||
|           cabal) | ||||
|             cabal --version | ||||
|             cabal update | ||||
|             PACKAGES=$(stack --install-ghc query locals | grep '^ *path' | sed 's@^ *path:@@') | ||||
|             cabal install --only-dependencies --enable-tests --enable-benchmarks --force-reinstalls --ghc-options=-O0 --reorder-goals --max-backjumps=-1 $CABALARGS $PACKAGES | ||||
|             ;; | ||||
|         esac | ||||
|         set +ex | ||||
|         ./stack --no-terminal --install-ghc $ARGS test --bench --only-dependencies | ||||
|       env: | ||||
|         ARGS: ${{ matrix.plan.resolver }} | ||||
|         BUILD: ${{ matrix.plan.build }} | ||||
|         # BUILD: ${{ matrix.plan.build }} | ||||
| 
 | ||||
|     - name: Build | ||||
|       run: | | ||||
|         set -ex | ||||
|         case "$BUILD" in | ||||
|           stack) | ||||
|             stack --no-terminal $ARGS test --bench --no-run-benchmarks --haddock --no-haddock-deps | ||||
|             ;; | ||||
|           cabal) | ||||
|             PACKAGES=$(stack --install-ghc query locals | grep '^ *path' | sed 's@^ *path:@@') | ||||
|             cabal install --enable-tests --enable-benchmarks --force-reinstalls --ghc-options=-O0 --reorder-goals --max-backjumps=-1 $CABALARGS $PACKAGES | ||||
| 
 | ||||
|             ORIGDIR=$(pwd) | ||||
|             for dir in $PACKAGES | ||||
|             do | ||||
|               cd $dir | ||||
|               cabal check || [ "$CABALVER" == "1.16" ] | ||||
|               cabal sdist | ||||
|               PKGVER=$(cabal info . | awk '{print $2;exit}') | ||||
|               SRC_TGZ=$PKGVER.tar.gz | ||||
|               cd dist | ||||
|               tar zxfv "$SRC_TGZ" | ||||
|               cd "$PKGVER" | ||||
|               cabal configure --enable-tests --ghc-options -O0 | ||||
|               cabal build | ||||
|               if [ "$CABALVER" = "1.16" ] || [ "$CABALVER" = "1.18" ]; then | ||||
|                 cabal test | ||||
|               else | ||||
|                 cabal test --show-details=streaming --log=/dev/stdout | ||||
|               fi | ||||
|               cd $ORIGDIR | ||||
|             done | ||||
|             ;; | ||||
|         esac | ||||
|         set +ex | ||||
|         ./stack --no-terminal $ARGS test --bench --no-run-benchmarks --haddock --no-haddock-deps | ||||
|       env: | ||||
|         ARGS: ${{ matrix.plan.resolver }} | ||||
|         BUILD: ${{ matrix.plan.build }} | ||||
|         # BUILD: ${{ matrix.plan.build }} | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user