Skip to content

Commit

Permalink
Fix haskell#29: new input cabal-update: false to skip 'cabal update' (
Browse files Browse the repository at this point in the history
haskell#146)

This commit introduces a new boolean input `cabal-update` that defaults to `true`.  
If set to `false`, the `cabal update` step will be skipped.

The new flag `cabal-update` is proper boolean, it only accepts the YAML 1.2 truth values `true` and `false` (also in captial and uppercase).
This is contrast to other "boolean" flags that are "unset" by default and can be "set" with any non-empty string.

To test that `cabal update` happens, this commit also introduces a new Haskell test project into CI that depends on a common Hackage package (`base-orphans`).

Original commits:
* Fix haskell#29: new input 'cabal-update: false' to turn off 'cabal update'
* Test 'cabal-update: false'
* README: Add 'cabal-update' to table of inputs
* Accept YAML 1.2 booleans as values for 'cabal-update'
* CI: test 'cabal-update: true': project with Hackage dependency
* Default value for 'cabal-update'
* CI: use cabal_update (underscore) in matrix
* Fixup: project with Hackage dependency
* Work around haskell#158
* Extra clarification of boolean vs "boolean" inputs
  • Loading branch information
andreasabel committed Jan 10, 2023
1 parent 2dccd74 commit d99497b
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,13 @@ jobs:
os: [ubuntu-latest, macOS-latest, windows-latest]
ghc: ["latest", "8.4.4"]
cabal: ["latest", "3.2.0.0"]
cabal_update: ["false"]
# The following tests do not set 'cabal-update', which defaults to 'true' then.
include:
- os: ubuntu-latest
ghc: "8.2.2"
cabal: "2.4.1.0"
cabal_update: "false"
- os: ubuntu-18.04
ghc: "7.4.1"
cabal: "3.4"
Expand All @@ -68,24 +71,36 @@ jobs:
cabal: "3.6"
steps:
- uses: actions/checkout@v3

- uses: ./setup
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
cabal-update: ${{ matrix.cabal_update }}

- name: Test runghc
run: |
runghc --version
runghc __tests__/hello.hs
- name: Build test project
working-directory: setup/__tests__/project
run: cabal build

- name: Run test project
working-directory: setup/__tests__/project
run: cabal run

- name: Build and run test with Hackage dependency
if: ${{ matrix.cabal_update != 'false' }}
working-directory: setup/__tests__/project-with-hackage-dependency
run: cabal build && cabal run

- name: Show installed versions
run: |
cabal --version
ghc --version
- name: Confirm installed and expected versions match
shell: bash
# check that if given in the matrix, the actual version matches:
Expand Down

0 comments on commit d99497b

Please sign in to comment.