Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add build-tool flag to omit tool and FV deps+modules from build #882

Merged
merged 8 commits into from
Jun 23, 2021
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion .github/workflows/applications.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
cabal: ['3.4']
os: ['ubuntu-18.04', 'ubuntu-20.04', 'macOS-latest' ] # windows-latest is temporarily disabled
cabalcache: ['true']
flags: ['+build-tool']
exclude:
- os: 'windows-latest'
ghc: '8.6.5'
Expand All @@ -24,6 +25,12 @@ jobs:
ghc: '8.10.4'
cabal: '3.4'
cabalcache: 'true'
flags: '+build-tool'
- os: 'ubuntu-20.04'
ghc: '8.10.5'
cabal: '3.4'
cabalcache: 'true'
flags: '-build-tool'
# include:
# - os: 'windows-latest'
# storepath: '--store-path=${HOME}/AppData/Roaming/cabal/store'
Expand Down Expand Up @@ -99,14 +106,19 @@ jobs:
benchmarks: True
documentation: False
optimization: 1
flags: ${{ matrix.flags }}
EOF
- name: Add check for unused packages
shell: bash
if: "! startsWith(matrix.ghc, '8.6') && ! startsWith(matrix.ghc, 8.8)"
run: |
cat > cabal.project.local <<EOF
cat >> cabal.project.local <<EOF
package pact
ghc-options: -Wunused-packages
EOF
- name: Print cabal.project.local
shell: bash
run: cat cabal.project.local
- uses: actions/cache@v2
name: Cache dist-newstyle
with:
Expand Down Expand Up @@ -143,9 +155,11 @@ jobs:
run: cabal build
- name: Test
shell: bash
if: "! contains(matrix.flags, '-build-tool')"
larskuhtz marked this conversation as resolved.
Show resolved Hide resolved
run: cabal test
- name: Benchmark
shell: bash
if: "! contains(matrix.flags, '-build-tool')"
run: cabal bench

# Publish Artifacts
Expand Down
12 changes: 1 addition & 11 deletions executables/Bench.hs
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
{-# LANGUAGE CPP #-}

module Main where

#if !defined(ghcjs_HOST_OS)
import qualified Pact.Bench as Bench
#endif


main :: IO ()
main =
#if defined(ghcjs_HOST_OS)
error "Error: command line REPL does not exist in GHCJS mode"
#else
Bench.main
#endif
main = Bench.main
12 changes: 1 addition & 11 deletions executables/GasModel.hs
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
{-# LANGUAGE CPP #-}

module Main where

#if !defined(ghcjs_HOST_OS)
import qualified Pact.GasModel.GasModel as GasModel
#endif


main :: IO ()
main =
#if defined(ghcjs_HOST_OS)
error "Error: gas model benchmarking does not exist in GHCJS mode"
#else
GasModel.main
#endif
main = GasModel.main
11 changes: 1 addition & 10 deletions executables/Repl.hs
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
{-# LANGUAGE CPP #-}

-- |
-- Copyright : (C) 2016 Stuart Popejoy
-- License : BSD-style (see the file LICENSE)
--

module Main where

#if !defined(ghcjs_HOST_OS)
import qualified Pact.Main as Repl
#endif

main :: IO ()
main =
#if defined(ghcjs_HOST_OS)
error "Error: command line REPL does not exist in GHCJS mode"
#else
Repl.main
#endif
main = Repl.main
Loading