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

[#454] Implement cross-platform GitHub Actions. #511

38 changes: 29 additions & 9 deletions summoner-cli/examples/cabal-full/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,59 @@ on:
branches: [master]

jobs:
build:
name: ghc ${{ matrix.ghc }}
runs-on: ubuntu-16.04
cabal:
name: ${{ matrix.os }} / ghc ${{ matrix.ghc }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
cabal: ["2.4"]
ghc:
- "8.4.4"
- "8.6.5"
- "8.8.4"
- "8.10.1"
exclude:
- os: macOS-latest
ghc: 8.4.4
- os: macOS-latest
ghc: 8.6.5
- os: macOS-latest
ghc: 8.8.4
- os: windows-latest
ghc: 8.4.4
- os: windows-latest
ghc: 8.6.5
- os: windows-latest
ghc: 8.8.4

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

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

- name: Freeze
run: |
cabal v2-freeze

- uses: actions/cache@v1
name: Cache ~/.cabal/store
with:
path: ~/.cabal/store
key: ${{ runner.os }}-${{ matrix.ghc }}-cabal
path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }}
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}

- name: Build
run: |
cabal v2-update
cabal v2-build --enable-tests --enable-benchmarks
cabal v2-configure --enable-tests --enable-benchmarks
cabal v2-build all

- name: Test
run: |
cabal v2-test --enable-tests --test-show-details=direct
gdziadkiewicz marked this conversation as resolved.
Show resolved Hide resolved
cabal v2-test all

gdziadkiewicz marked this conversation as resolved.
Show resolved Hide resolved
5 changes: 3 additions & 2 deletions summoner-cli/examples/cabal-full/.travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ install:
- curl -sSL https://raw.github.com/ndmitchell/neil/master/misc/travis.sh | sh -s -- hlint .

- cabal v2-update
- cabal v2-build --enable-tests --enable-benchmarks
- cabal v2-configure --enable-tests --enable-benchmarks
- cabal v2-build all

script:
- cabal v2-test --enable-tests --test-show-details=direct
- cabal v2-test all

notifications:
email: false
83 changes: 74 additions & 9 deletions summoner-cli/examples/full-batteries/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ on:
branches: [master]

jobs:
build:
name: ghc ${{ matrix.ghc }}
runs-on: ubuntu-16.04
cabal:
name: ${{ matrix.os }} / ghc ${{ matrix.ghc }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
cabal: ["2.4"]
ghc:
- "8.0.2"
Expand All @@ -20,28 +21,92 @@ jobs:
- "8.6.5"
- "8.8.4"
- "8.10.1"
exclude:
- os: macOS-latest
ghc: 8.0.2
- os: macOS-latest
ghc: 8.2.2
- os: macOS-latest
ghc: 8.4.4
- os: macOS-latest
ghc: 8.6.5
- os: macOS-latest
ghc: 8.8.4
- os: windows-latest
ghc: 8.0.2
- os: windows-latest
ghc: 8.2.2
- os: windows-latest
ghc: 8.4.4
- os: windows-latest
ghc: 8.6.5
- os: windows-latest
ghc: 8.8.4

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

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

- name: Freeze
run: |
cabal v2-freeze

- uses: actions/cache@v1
name: Cache ~/.cabal/store
with:
path: ~/.cabal/store
key: ${{ runner.os }}-${{ matrix.ghc }}-cabal
path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }}
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}

- name: Build
run: |
cabal v2-configure --enable-tests --enable-benchmarks
cabal v2-build all

- name: Test
run: |
cabal v2-test all

stack:
name: stack / ghc ${{ matrix.ghc }}
runs-on: ubuntu-latest
gdziadkiewicz marked this conversation as resolved.
Show resolved Hide resolved
strategy:
matrix:
stack: ["2.3.3"]
ghc:
- "8.0.2"
- "8.2.2"
- "8.4.4"
- "8.6.5"
- "8.8.4"
- "8.10.1"

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

- uses: actions/[email protected]
name: Setup Haskell Stack
with:
ghc-version: ${{ matrix.ghc }}
stack-version: ${{ matrix.stack }}

- uses: actions/cache@v1
name: Cache ~/.stack
with:
path: ~/.stack
key: ${{ runner.os }}-${{ matrix.ghc }}-stack

- name: Build
run: |
cabal v2-update
cabal v2-build --enable-tests --enable-benchmarks
stack build --system-ghc --test --bench --no-run-tests --no-run-benchmarks --ghc-options=-Werror

- name: Test
run: |
cabal v2-test --enable-tests --test-show-details=direct
stack test --system-ghc
5 changes: 3 additions & 2 deletions summoner-cli/examples/full-batteries/.travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ install:
- |
if [ -z "$STACK_YAML" ]; then
cabal v2-update
cabal v2-build --enable-tests --enable-benchmarks
cabal v2-configure --enable-tests --enable-benchmarks
cabal v2-build all
else
curl -sSL https://get.haskellstack.org/ | sh
stack --version
Expand All @@ -66,7 +67,7 @@ install:
script:
- |
if [ -z "$STACK_YAML" ]; then
cabal v2-test --enable-tests --test-show-details=direct
cabal v2-test all
else
stack test --system-ghc
fi
Expand Down
44 changes: 44 additions & 0 deletions summoner-cli/examples/stack-full/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: CI

# Trigger the workflow on push or pull request, but only for the master branch
on:
pull_request:
push:
branches: [master]

jobs:
stack:
name: stack / ghc ${{ matrix.ghc }}
runs-on: ubuntu-latest
strategy:
matrix:
stack: ["2.3.3"]
ghc:
- "8.4.4"
- "8.6.5"
- "8.8.4"
- "8.10.1"

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

- uses: actions/[email protected]
name: Setup Haskell Stack
with:
ghc-version: ${{ matrix.ghc }}
stack-version: ${{ matrix.stack }}

- uses: actions/cache@v1
name: Cache ~/.stack
with:
path: ~/.stack
key: ${{ runner.os }}-${{ matrix.ghc }}-stack

- name: Build
run: |
stack build --system-ghc --test --bench --no-run-tests --no-run-benchmarks --ghc-options=-Werror

- name: Test
run: |
stack test --system-ghc
1 change: 1 addition & 0 deletions summoner-cli/examples/stack-full/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# stack-full

[![GitHub CI](https://github.com/kowainik/stack-full/workflows/CI/badge.svg)](https://github.com/kowainik/stack-full/actions)
[![Build status](https://img.shields.io/travis/kowainik/stack-full.svg?logo=travis)](https://travis-ci.com/kowainik/stack-full)
[![Windows build status](https://ci.appveyor.com/api/projects/status/github/kowainik/stack-full?branch=master&svg=true)](https://ci.appveyor.com/project/kowainik/stack-full)
[![Hackage](https://img.shields.io/hackage/v/stack-full.svg?logo=haskell)](https://hackage.haskell.org/package/stack-full)
Expand Down
5 changes: 5 additions & 0 deletions summoner-cli/src/Summoner/Default.hs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ This module contains some default values to use.
module Summoner.Default
( defaultGHC
, defaultCabal
, defaultStack
, defaultLicenseName
, defaultOwner
, defaultFullName
Expand Down Expand Up @@ -42,6 +43,10 @@ defaultGHC = maxBound
defaultCabal :: Text
defaultCabal = "2.4"

-- | Default version of the Stack.
defaultStack :: Text
defaultStack = "2.3.3"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2.5.1 was released since I did that. Should I update it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to 2.5.1 .


defaultLicenseName :: LicenseName
defaultLicenseName = MIT

Expand Down
2 changes: 1 addition & 1 deletion summoner-cli/src/Summoner/Project.hs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ generateProjectInteractive connectMode projectName ConfigP{..} = do
(settingsGitHub && not settingsNoUpload)
(YesNoPrompt "private repository" "Create as a private repository (Requires a GitHub private repo plan)?")
cPrivate
settingsGhActions <- decisionIf (settingsCabal && settingsGitHub) (mkDefaultYesNoPrompt "GitHub Actions CI integration") cGhActions
settingsGhActions <- decisionIf settingsGitHub (mkDefaultYesNoPrompt "GitHub Actions CI integration") cGhActions
gdziadkiewicz marked this conversation as resolved.
Show resolved Hide resolved
settingsTravis <- decisionIf settingsGitHub (mkDefaultYesNoPrompt "Travis CI integration") cTravis
settingsAppVeyor <- decisionIf settingsGitHub (mkDefaultYesNoPrompt "AppVeyor CI integration") cAppVey
settingsIsLib <- promptDecisionToBool cLib (mkDefaultYesNoPrompt "library target")
Expand Down
Loading