Skip to content

Commit

Permalink
[#340] Move to cabal-3.0
Browse files Browse the repository at this point in the history
Resolves #340
  • Loading branch information
chshersh committed Jan 11, 2022
1 parent 3dcab67 commit 12bc648
Show file tree
Hide file tree
Showing 20 changed files with 142 additions and 94 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@ on:
# additionally run once per week (At 00:00 on Sunday) to maintain cache
- cron: '0 0 * * 0'


jobs:
cabal:
name: ${{ matrix.os }} / ghc ${{ matrix.ghc }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
cabal: ["3.4"]
cabal: ["3.6"]
ghc:
- "8.4.4"
- "8.6.5"
Expand Down Expand Up @@ -46,7 +45,7 @@ jobs:
steps:
- uses: actions/checkout@v2

- uses: haskell/actions/setup@v1
- uses: haskell/actions/setup@v1.2
id: setup-haskell-cabal
name: Setup Haskell
with:
Expand All @@ -61,7 +60,7 @@ jobs:
run: |
cabal freeze
- uses: actions/cache@v2.1.4
- uses: actions/cache@v2
name: Cache ~/.cabal/store
with:
path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }}
Expand All @@ -77,7 +76,7 @@ jobs:
- name: Unit and property tests
run: |
cabal test all --enable-tests --test-show-details=direct
cabal test all
- if: matrix.ghc == '8.10.7'
name: Build 'cabal-minimal'
Expand Down Expand Up @@ -112,7 +111,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
stack: ["2.5"]
stack: ["2.7.3"]
ghc: ["8.10.7"]

steps:
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ The changelog is available [on GitHub][2].
* [#517](https://github.com/kowainik/summoner/issues/517):
Switch to `main` initial branch when creating project.
* Require `git >= 2.28` for `--initial-branch=main` option.
* [#491](https://github.com/kowainik/summoner/issues/491):
Use `cabal` version `3.0`.
* __#TUI__ Upgrade `brick` allowed version. Bump up lower
bound to `0.56` due to the new field `formFieldUpdate`
addition to the `FormFieldState` data type.
Expand Down
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ To start using Summoner make sure that you have the following tools installed on

We also have minimal version requirements for build tools:

* [Cabal ⩾ 2.4](https://www.haskell.org/cabal/)
* [Cabal ⩾ 3.0](https://www.haskell.org/cabal/)
* [Stack ⩾ 2.1.3](http://haskellstack.org)

However, it is always recommended to use the newest versions of build tools.
Expand Down Expand Up @@ -303,8 +303,8 @@ $ sudo apt install summoner-tui
Using `cabal`:

```shell
cabal v2-update
cabal v2-install summoner-tui
cabal update
cabal install summoner-tui
```

##### TUI: from source
Expand Down Expand Up @@ -332,7 +332,7 @@ cd summoner
Build and install using `cabal`:

```shell
cabal v2-install summoner-tui:exe:summon-tui
cabal install summoner-tui:exe:summon-tui
```

Build and install using `stack`:
Expand Down Expand Up @@ -391,8 +391,8 @@ $ sudo apt install summoner-cli
Using `cabal`:

```shell
cabal v2-update
cabal v2-install summoner
cabal update
cabal install summoner
```

##### CLI: from source
Expand Down Expand Up @@ -420,7 +420,7 @@ cd summoner
Build and install using `cabal`:

```shell
cabal v2-install summoner-cli:exe:summon
cabal install summoner-cli:exe:summon
```

Build and install using `stack`:
Expand Down Expand Up @@ -804,7 +804,7 @@ On Linux, to build the `summoner-tui` you'll need to have `libtinfo` installed.
To build the project you can use the following commands:

```shell=
cabal v2-build all
cabal build all
```

for Cabal and
Expand All @@ -824,7 +824,7 @@ Summoner uses the golden tests technique for assuring the correctness of the gen
To actually run tests you need to run:

```shell
cabal v2-test all
cabal test all
```

or, if using Stack
Expand All @@ -840,8 +840,8 @@ stack test
Building Summoner with the recommended method creates two executables: `summon` and `summon-tui`. To run the compiled executable you can use the following commands:

```shell
cabal v2-exec summon -- SOME_COMMAND
cabal v2-exec summon-tui -- SOME_COMMAND
cabal exec summon -- SOME_COMMAND
cabal exec summon-tui -- SOME_COMMAND
```

or, if using Stack
Expand Down
34 changes: 24 additions & 10 deletions summoner-cli/examples/cabal-full/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
name: CI

# Trigger the workflow on push or pull request, but only for the main branch
on:
pull_request:
types: [synchronize, opened, reopened]
push:
branches: [main]
schedule:
# additionally run once per week (At 00:00 on Sunday) to maintain cache
- cron: '0 0 * * 0'

jobs:
cabal:
Expand All @@ -13,7 +16,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
cabal: ["2.4"]
cabal: ["3.0"]
ghc:
- "8.4.4"
- "8.6.5"
Expand All @@ -34,31 +37,42 @@ jobs:
ghc: 8.4.4

steps:
- uses: actions/checkout@v2.3.3
if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/main'
- uses: actions/checkout@v2

- uses: haskell/actions/setup@v1
- uses: haskell/actions/setup@v1.2
id: setup-haskell-cabal
name: Setup Haskell
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}

- name: Configure
run: |
cabal configure --enable-tests --enable-benchmarks --enable-documentation --test-show-details=direct --write-ghc-environment-files=always
- name: Freeze
run: |
cabal v2-freeze
cabal freeze
- uses: actions/cache@v2.1.2
- uses: actions/cache@v2
name: Cache ~/.cabal/store
with:
path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }}
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}

- name: Install dependencies
run: |
cabal build all --only-dependencies
- name: Build
run: |
cabal v2-configure --enable-tests --enable-benchmarks --test-show-details=direct
cabal v2-build all
cabal build all
- name: Test
run: |
cabal v2-test all
cabal test all
- name: Documentation
run: |
cabal haddock
10 changes: 5 additions & 5 deletions summoner-cli/examples/cabal-full/.travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ language: haskell
git:
depth: 5

cabal: "2.4"
cabal: "3.0"

cache:
directories:
Expand All @@ -20,12 +20,12 @@ install:
# HLint check
- curl -sSL https://raw.github.com/ndmitchell/neil/master/misc/travis.sh | sh -s -- hlint .

- cabal v2-update
- cabal v2-configure --enable-tests --enable-benchmarks --test-show-details=direct
- cabal v2-build all
- cabal update
- cabal configure --enable-tests --enable-benchmarks --enable-documentation --test-show-details=direct --write-ghc-environment-files=always
- cabal build all

script:
- cabal v2-test all
- cabal test all

notifications:
email: false
10 changes: 5 additions & 5 deletions summoner-cli/examples/cabal-full/appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ environment:

install:
- choco source add -n mistuke -s https://www.myget.org/F/mistuke/api/v2
- choco install -y cabal --version 2.4.1.0
- choco install -y cabal --version 3.6.2.0
- choco install -y ghc --version 8.10.7
- refreshenv

before_build:
- cabal --version
- ghc --version
- cabal %CABOPTS% v2-update
- cabal %CABOPTS% update

build_script:
- cabal %CABOPTS% v2-configure --enable-tests --enable-benchmarks --test-show-details=direct
- cabal %CABOPTS% v2-build all
- cabal %CABOPTS% v2-test all
- cabal %CABOPTS% configure --enable-tests --enable-benchmarks --enable-documentation --test-show-details=direct --write-ghc-environment-files=always
- cabal %CABOPTS% build all
- cabal %CABOPTS% test all
2 changes: 1 addition & 1 deletion summoner-cli/examples/cabal-full/cabal-full.cabal
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cabal-version: 2.4
cabal-version: 3.0
name: cabal-full
version: 0.0.0.0
synopsis: Cabal-only example with all integrations
Expand Down
2 changes: 1 addition & 1 deletion summoner-cli/examples/cabal-minimal/cabal-minimal.cabal
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cabal-version: 2.4
cabal-version: 3.0
name: cabal-minimal
version: 0.0.0.0
synopsis: Minimal cabal-only test project
Expand Down
42 changes: 28 additions & 14 deletions summoner-cli/examples/full-batteries/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
name: CI

# Trigger the workflow on push or pull request, but only for the main branch
on:
pull_request:
types: [synchronize, opened, reopened]
push:
branches: [main]
schedule:
# additionally run once per week (At 00:00 on Sunday) to maintain cache
- cron: '0 0 * * 0'

jobs:
cabal:
Expand All @@ -13,7 +16,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
cabal: ["2.4"]
cabal: ["3.0"]
ghc:
- "8.0.2"
- "8.2.2"
Expand Down Expand Up @@ -44,41 +47,52 @@ jobs:
ghc: 8.0.2

steps:
- uses: actions/checkout@v2.3.3
if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/main'
- uses: actions/checkout@v2

- uses: haskell/actions/setup@v1
- uses: haskell/actions/setup@v1.2
id: setup-haskell-cabal
name: Setup Haskell
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}

- name: Configure
run: |
cabal configure --enable-tests --enable-benchmarks --enable-documentation --test-show-details=direct --write-ghc-environment-files=always
- name: Freeze
run: |
cabal v2-freeze
cabal freeze
- uses: actions/cache@v2.1.2
- uses: actions/cache@v2
name: Cache ~/.cabal/store
with:
path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }}
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}

- name: Install dependencies
run: |
cabal build all --only-dependencies
- name: Build
run: |
cabal v2-configure --enable-tests --enable-benchmarks --test-show-details=direct
cabal v2-build all
cabal build all
- name: Test
run: |
cabal v2-test all
cabal test all
- name: Documentation
run: |
cabal haddock
stack:
name: stack / ghc ${{ matrix.ghc }}
runs-on: ubuntu-latest
strategy:
matrix:
stack: ["2.5.1"]
stack: ["2.7.3"]
ghc:
- "8.0.2"
- "8.2.2"
Expand All @@ -88,16 +102,16 @@ jobs:
- "8.10.7"

steps:
- uses: actions/checkout@v2.3.3
- uses: actions/checkout@v2
if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/main'

- uses: haskell/actions/setup@v1
- uses: haskell/actions/setup@v1.2
name: Setup Haskell Stack
with:
ghc-version: ${{ matrix.ghc }}
stack-version: ${{ matrix.stack }}

- uses: actions/cache@v2.1.2
- uses: actions/cache@v2
name: Cache ~/.stack
with:
path: ~/.stack
Expand Down
Loading

0 comments on commit 12bc648

Please sign in to comment.