Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit 6e6e0ae

Browse files
author
Jared Weakly
committed
Migrate to haskell/setup/actions directory
1 parent 49b6c7a commit 6e6e0ae

28 files changed

+217
-204
lines changed

.github/workflows/workflow.yml

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
1-
name: build-test
1+
name: Setup
22
on:
33
push:
44
branches:
55
- main
66
paths-ignore:
7-
- '**.md'
7+
- "**.md"
88
pull_request:
99
paths-ignore:
10-
- '**.md'
10+
- "**.md"
11+
12+
defaults:
13+
run:
14+
working-directory: setup
15+
1116
jobs:
1217
test:
1318
name: Unit Tests - ${{ matrix.os }}
@@ -35,19 +40,19 @@ jobs:
3540
fail-fast: false
3641
matrix:
3742
os: [ubuntu-latest, macOS-latest, windows-latest]
38-
ghc: ['latest', '8.4.4']
39-
cabal: ['latest']
43+
ghc: ["latest", "8.4.4"]
44+
cabal: ["latest"]
4045
include:
4146
- os: ubuntu-latest
42-
ghc: '7.10.3'
43-
cabal: '3.0.0.0'
47+
ghc: "7.10.3"
48+
cabal: "3.0.0.0"
4449
- os: ubuntu-latest
45-
ghc: '8.2.2'
46-
cabal: '2.0'
50+
ghc: "8.2.2"
51+
cabal: "2.0"
4752

4853
steps:
4954
- uses: actions/checkout@v2
50-
- uses: ./
55+
- uses: ./setup
5156
with:
5257
ghc-version: ${{ matrix.ghc }}
5358
cabal-version: ${{ matrix.cabal }}
@@ -72,12 +77,11 @@ jobs:
7277
fail-fast: false
7378
matrix:
7479
os: [ubuntu-latest, macOS-latest, windows-latest]
75-
stack: ['latest', '1.9.1']
80+
stack: ["latest", "1.9.1"]
7681

7782
steps:
7883
- uses: actions/checkout@v2
79-
80-
- uses: ./
84+
- uses: ./setup
8185
with:
8286
enable-stack: true
8387
stack-no-global: true

README.md

Lines changed: 6 additions & 190 deletions
Original file line numberDiff line numberDiff line change
@@ -1,193 +1,9 @@
1-
# setup-haskell
1+
# Haskell Github Actions
22

3-
[![GitHub Actions status](https://github.com/actions/setup-haskell/workflows/Main%20workflow/badge.svg)](https://github.com/actions/setup-haskell)
3+
A Collection of GitHub actions for interacting with Haskell.
44

5-
This action sets up a Haskell environment for use in actions by:
5+
| Action |
6+
| ---------------------------------- |
7+
| [`haskell/actions/setup`](./setup) |
68

7-
- optionally installing a version of [ghc](https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/) and [cabal](https://www.haskell.org/cabal/) and adding to PATH.
8-
- optionally installing a version of [Stack](https://haskellstack.org) and adding to PATH.
9-
- setting the outputs of `ghc-path`, `cabal-path`, `stack-path`, and `cabal-store` when necessary.
10-
11-
The GitHub runners come with [pre-installed versions of GHC and Cabal](https://help.github.com/en/actions/reference/software-installed-on-github-hosted-runners). Those will be used whenever possible.
12-
For all other versions, this action utilizes [`ppa:hvr/ghc`](https://launchpad.net/~hvr/+archive/ubuntu/ghc), [`ghcup`](https://gitlab.haskell.org/haskell/ghcup-hs), and [`chocolatey`](https://chocolatey.org/packages/ghc).
13-
14-
## Usage
15-
16-
See [action.yml](action.yml)
17-
18-
Minimal:
19-
20-
```yaml
21-
on: [push]
22-
name: build
23-
jobs:
24-
runhaskell:
25-
name: Hello World
26-
runs-on: ubuntu-latest # or macOS-latest, or windows-latest
27-
steps:
28-
- uses: actions/checkout@v2
29-
- uses: actions/[email protected]
30-
- run: runhaskell Hello.hs
31-
```
32-
33-
Basic:
34-
35-
```yaml
36-
on: [push]
37-
name: build
38-
jobs:
39-
runhaskell:
40-
name: Hello World
41-
runs-on: ubuntu-latest # or macOS-latest, or windows-latest
42-
steps:
43-
- uses: actions/checkout@v2
44-
- uses: actions/[email protected]
45-
with:
46-
ghc-version: '8.8' # Resolves to the latest point release of GHC 8.8
47-
cabal-version: '3.0.0.0' # Exact version of Cabal
48-
- run: runhaskell Hello.hs
49-
```
50-
51-
Basic with Stack:
52-
53-
```yaml
54-
on: [push]
55-
name: build
56-
jobs:
57-
runhaskell:
58-
name: Hello World
59-
runs-on: ubuntu-latest # or macOS-latest, or windows-latest
60-
steps:
61-
- uses: actions/checkout@v2
62-
- uses: actions/[email protected]
63-
with:
64-
ghc-version: '8.8.3' # Exact version of ghc to use
65-
# cabal-version: 'latest'. Omitted, but defalts to 'latest'
66-
enable-stack: true
67-
stack-version: 'latest'
68-
- run: runhaskell Hello.hs
69-
```
70-
71-
Matrix Testing:
72-
73-
```yaml
74-
on: [push]
75-
name: build
76-
jobs:
77-
build:
78-
runs-on: ${{ matrix.os }}
79-
strategy:
80-
matrix:
81-
ghc: ['8.6.5', '8.8.3']
82-
cabal: ['2.4.1.0', '3.0.0.0']
83-
os: [ubuntu-latest, macOS-latest, windows-latest]
84-
exclude:
85-
# GHC 8.8+ only works with cabal v3+
86-
- ghc: 8.8.3
87-
cabal: 2.4.1.0
88-
name: Haskell GHC ${{ matrix.ghc }} sample
89-
steps:
90-
- uses: actions/checkout@v2
91-
- name: Setup Haskell
92-
uses: actions/[email protected]
93-
with:
94-
ghc-version: ${{ matrix.ghc }}
95-
cabal-version: ${{ matrix.cabal }}
96-
- run: runhaskell Hello.hs
97-
```
98-
99-
## Inputs
100-
101-
| Name | Required | Description | Type | Default |
102-
| ----------------- | :------: | ---------------------------------------------------------------------------------------------------------------------------------------------- | --------- | ------- |
103-
| `ghc-version` | | GHC version to use, ex. `latest` | string | latest |
104-
| `cabal-version` | | Cabal version to use, ex. `3.2` | string | latest |
105-
| `stack-version` | | Stack version to use, ex. `latest`. Stack will only be installed if enable-stack is set. | string | latest |
106-
| `enable-stack` | | If specified, will setup Stack. | "boolean" | false |
107-
| `stack-no-global` | | If specified, enable-stack must be set. Prevents installing GHC and Cabal globally | "boolean" | false |
108-
| `stack-setup-ghc` | | If specified, enable-stack must be set. Runs stack setup to install the specified GHC. (Note: setting this does _not_ imply `stack-no-global`) | "boolean" | false |
109-
110-
## Outputs
111-
112-
| Name | Description | Type |
113-
| ------------- | -------------------------------------------- | ------ |
114-
| `ghc-path` | The path of the ghc executable _directory_ | string |
115-
| `cabal-path` | The path of the cabal executable _directory_ | string |
116-
| `stack-path` | The path of the stack executable _directory_ | string |
117-
| `cabal-store` | The path to the cabal store | string |
118-
| `ghc-exe` | The path of the ghc _executable_ | string |
119-
| `cabal-exe` | The path of the cabal _executable_ | string |
120-
| `stack-exe` | The path of the stack _executable_ | string |
121-
122-
## Version Support
123-
124-
**GHC:**
125-
126-
- `latest` (default, recommended)
127-
- `8.10.1` `8.10`
128-
- `8.8.3` `8.8`
129-
- `8.8.2`
130-
- `8.8.1`
131-
- `8.6.5` `8.6`
132-
- `8.6.4`
133-
- `8.6.3`
134-
- `8.6.2`
135-
- `8.6.1`
136-
- `8.4.4` `8.4`
137-
- `8.4.3`
138-
- `8.4.2`
139-
- `8.4.1`
140-
- `8.2.2` `8.2`
141-
- `8.0.2` `8.0`
142-
- `7.10.3` `7.10`
143-
144-
Suggestion: Try to support the three latest major versions of GHC.
145-
146-
**Cabal:**
147-
148-
- `latest` (default, recommended)
149-
- `3.2.0.0` `3.2`
150-
- `3.0.0.0` `3.0`
151-
- `2.4.1.0` `2.4`
152-
- `2.4.0.0`
153-
- `2.2.0.0` `2.2`
154-
155-
Recommendation: Use the latest available version if possible.
156-
157-
**Stack:**
158-
159-
- `latest` (recommended) -- follows the latest release automatically.
160-
- `2.3.1` `2.3`
161-
- `2.1.3` `2.1`
162-
- `2.1.1`
163-
- `1.9.3.1` `1.9`
164-
- `1.9.1.1`
165-
- `1.7.1` `1.7`
166-
- `1.6.5` `1.6`
167-
- `1.6.3.1`
168-
- `1.6.1.1`
169-
- `1.5.1` `1.5`
170-
- `1.5.0`
171-
- `1.4.0` `1.4`
172-
- `1.3.2` `1.3`
173-
- `1.3.0`
174-
- `1.2.0` `1.2`
175-
176-
Recommendation: Use the latest available version if possible.
177-
178-
The full list of available versions of GHC, Cabal, and Stack are as follows:
179-
180-
- [Linux/macOS - Cabal and GHC](https://www.haskell.org/ghc/download.html)
181-
- [Windows - Cabal](https://chocolatey.org/packages/cabal#versionhistory).
182-
- [Windows - GHC](https://chocolatey.org/packages/ghc#versionhistory)
183-
- [Linux/macOS/Windows - Stack](https://github.com/commercialhaskell/stack/tags)
184-
185-
Note: There are _technically_ some descrepencies here. For example, "8.10.1-alpha1" will work for a ghc version for windows but not for Linux and macOS. For your sanity, I suggest sticking with the version lists above which are supported across all three operating systems.
186-
187-
## License
188-
189-
The scripts and documentation in this project are released under the [MIT License](LICENSE).
190-
191-
## Contributions
192-
193-
Contributions are welcome! See the [Contributor's Guide](docs/contributors.md).
9+
See the individual action directory for details on usage and examples.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)