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

Commit c1b48c3

Browse files
authored
Merge pull request #15 from haskell-CI/releases/v1.1
Update documentation to v1.1
2 parents 2bb8480 + bc8c103 commit c1b48c3

File tree

5 files changed

+21
-21
lines changed

5 files changed

+21
-21
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
runs-on: ubuntu-latest # or macOS-latest, or windows-latest
2727
steps:
2828
- uses: actions/checkout@v2
29-
- uses: actions/setup-haskell@v1
29+
- uses: actions/setup-haskell@v1.1
3030
- run: runhaskell Hello.hs
3131
```
3232
@@ -41,7 +41,7 @@ jobs:
4141
runs-on: ubuntu-latest # or macOS-latest, or windows-latest
4242
steps:
4343
- uses: actions/checkout@v2
44-
- uses: actions/setup-haskell@v1
44+
- uses: actions/setup-haskell@v1.1
4545
with:
4646
ghc-version: '8.8' # Resolves to the latest point release of GHC 8.8
4747
cabal-version: '3.0.0.0' # Exact version of Cabal
@@ -59,7 +59,7 @@ jobs:
5959
runs-on: ubuntu-latest # or macOS-latest, or windows-latest
6060
steps:
6161
- uses: actions/checkout@v2
62-
- uses: actions/setup-haskell@v1
62+
- uses: actions/setup-haskell@v1.1
6363
with:
6464
ghc-version: '8.8.3' # Exact version of ghc to use
6565
# cabal-version: 'latest'. Omitted, but defalts to 'latest'
@@ -88,7 +88,7 @@ jobs:
8888
steps:
8989
- uses: actions/checkout@v2
9090
- name: Setup Haskell
91-
uses: actions/setup-haskell@v1
91+
uses: actions/setup-haskell@v1.1
9292
with:
9393
ghc-version: ${{ matrix.ghc }}
9494
cabal-version: ${{ matrix.cabal }}
@@ -156,6 +156,7 @@ Recommendation: Use the latest available version if possible.
156156
**Stack:**
157157

158158
- `latest` (recommended) -- follows the latest release automatically.
159+
- `2.3.1` `2.3`
159160
- `2.1.3` `2.1`
160161
- `2.1.1`
161162
- `1.9.3.1` `1.9`

__tests__/find-haskell.test.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ import {getInput} from '@actions/core';
33
import * as supported_versions from '../src/versions.json';
44

55
const def = getDefaults();
6+
const latestVersions = {
7+
ghc: supported_versions.ghc[0],
8+
cabal: supported_versions.cabal[0],
9+
stack: supported_versions.stack[0]
10+
};
611

712
const mkName = (s: string): string =>
813
`INPUT_${s.replace(/ /g, '_').toUpperCase()}`;
@@ -25,8 +30,7 @@ describe('actions/setup-haskell', () => {
2530
afterEach(() => (process.env = OLD_ENV));
2631

2732
it('Parses action.yml to get correct default versions', () => {
28-
const defs = {ghc: '8.10.1', cabal: '3.2.0.0', stack: '2.1.3'};
29-
forAll(t => expect(def[t].version).toBe(defs[t]));
33+
forAll(t => expect(def[t].version).toBe(latestVersions[t]));
3034
});
3135

3236
it('Supported versions are parsed from JSON correctly', () =>
@@ -56,14 +60,13 @@ describe('actions/setup-haskell', () => {
5660
});
5761

5862
it('"latest" Versions resolve correctly', () => {
59-
const v = {ghc: '8.6.5', cabal: '2.4.1.0', stack: '2.1.3'};
6063
setupEnv({
61-
'stack-version': '2.1',
62-
'ghc-version': '8.6',
63-
'cabal-version': '2.4'
64+
'stack-version': 'latest',
65+
'ghc-version': 'latest',
66+
'cabal-version': 'latest'
6467
});
6568
const options = getOpts(def);
66-
forAll(t => expect(options[t].resolved).toBe(v[t]));
69+
forAll(t => expect(options[t].resolved).toBe(latestVersions[t]));
6770
});
6871

6972
it('Enabling stack does not disable GHC or Cabal', () => {

dist/index.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2584,7 +2584,7 @@ function escapeProperty(s) {
25842584
/***/ 447:
25852585
/***/ (function(module) {
25862586

2587-
module.exports = {"ghc":["8.10.1","8.8.3","8.8.2","8.8.1","8.6.5","8.6.4","8.6.3","8.6.2","8.6.1","8.4.4","8.4.3","8.4.2","8.4.1","8.2.2","8.0.2","7.10.3"],"cabal":["3.2.0.0","3.0.0.0","2.4.1.0","2.4.0.0","2.2.0.0"],"stack":["2.1.3","2.1.1","1.9.3","1.9.1","1.7.1","1.6.5","1.6.3","1.6.1","1.5.1","1.5.0","1.4.0","1.3.2","1.3.0","1.2.0"]};
2587+
module.exports = {"ghc":["8.10.1","8.8.3","8.8.2","8.8.1","8.6.5","8.6.4","8.6.3","8.6.2","8.6.1","8.4.4","8.4.3","8.4.2","8.4.1","8.2.2","8.0.2","7.10.3"],"cabal":["3.2.0.0","3.0.0.0","2.4.1.0","2.4.0.0","2.2.0.0"],"stack":["2.3.1","2.1.3","2.1.1","1.9.3","1.9.1","1.7.1","1.6.5","1.6.3","1.6.1","1.5.1","1.5.0","1.4.0","1.3.2","1.3.0","1.2.0"]};
25882588

25892589
/***/ }),
25902590

@@ -10721,13 +10721,11 @@ exports.installTool = installTool;
1072110721
async function stack(version, os) {
1072210722
core.info(`Attempting to install stack ${version}`);
1072310723
const build = {
10724-
linux: 'linux-x86_64-static',
10724+
linux: `linux-x86_64${version >= '2.3.1' ? '' : '-static'}`,
1072510725
darwin: 'osx-x86_64',
1072610726
win32: 'windows-x86_64'
1072710727
}[os];
10728-
const url = version === 'latest'
10729-
? `https://get.haskellstack.org/stable/${build}.tar.gz`
10730-
: `https://github.com/commercialhaskell/stack/releases/download/v${version}/stack-${version}-${build}.tar.gz`;
10728+
const url = `https://github.com/commercialhaskell/stack/releases/download/v${version}/stack-${version}-${build}.tar.gz`;
1073110729
const p = await tc.downloadTool(`${url}`).then(tc.extractTar);
1073210730
const [stackPath] = await glob_1.create(`${p}/stack*`, {
1073310731
implicitDescendants: false

src/installer.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,15 +135,12 @@ export async function installTool(
135135
async function stack(version: string, os: OS): Promise<void> {
136136
core.info(`Attempting to install stack ${version}`);
137137
const build = {
138-
linux: 'linux-x86_64-static',
138+
linux: `linux-x86_64${version >= '2.3.1' ? '' : '-static'}`,
139139
darwin: 'osx-x86_64',
140140
win32: 'windows-x86_64'
141141
}[os];
142142

143-
const url =
144-
version === 'latest'
145-
? `https://get.haskellstack.org/stable/${build}.tar.gz`
146-
: `https://github.com/commercialhaskell/stack/releases/download/v${version}/stack-${version}-${build}.tar.gz`;
143+
const url = `https://github.com/commercialhaskell/stack/releases/download/v${version}/stack-${version}-${build}.tar.gz`;
147144
const p = await tc.downloadTool(`${url}`).then(tc.extractTar);
148145
const [stackPath] = await glob(`${p}/stack*`, {
149146
implicitDescendants: false

src/versions.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
],
2020
"cabal": ["3.2.0.0", "3.0.0.0", "2.4.1.0", "2.4.0.0", "2.2.0.0"],
2121
"stack": [
22+
"2.3.1",
2223
"2.1.3",
2324
"2.1.1",
2425
"1.9.3",

0 commit comments

Comments
 (0)