Skip to content
This repository has been archived by the owner on Dec 12, 2020. It is now read-only.

Commit

Permalink
Merge pull request #15 from haskell-CI/releases/v1.1
Browse files Browse the repository at this point in the history
Update documentation to v1.1
  • Loading branch information
tclem authored May 4, 2020
2 parents 2bb8480 + bc8c103 commit c1b48c3
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 21 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
runs-on: ubuntu-latest # or macOS-latest, or windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-haskell@v1
- uses: actions/setup-haskell@v1.1
- run: runhaskell Hello.hs
```
Expand All @@ -41,7 +41,7 @@ jobs:
runs-on: ubuntu-latest # or macOS-latest, or windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-haskell@v1
- uses: actions/setup-haskell@v1.1
with:
ghc-version: '8.8' # Resolves to the latest point release of GHC 8.8
cabal-version: '3.0.0.0' # Exact version of Cabal
Expand All @@ -59,7 +59,7 @@ jobs:
runs-on: ubuntu-latest # or macOS-latest, or windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-haskell@v1
- uses: actions/setup-haskell@v1.1
with:
ghc-version: '8.8.3' # Exact version of ghc to use
# cabal-version: 'latest'. Omitted, but defalts to 'latest'
Expand Down Expand Up @@ -88,7 +88,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Setup Haskell
uses: actions/setup-haskell@v1
uses: actions/setup-haskell@v1.1
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
Expand Down Expand Up @@ -156,6 +156,7 @@ Recommendation: Use the latest available version if possible.
**Stack:**

- `latest` (recommended) -- follows the latest release automatically.
- `2.3.1` `2.3`
- `2.1.3` `2.1`
- `2.1.1`
- `1.9.3.1` `1.9`
Expand Down
17 changes: 10 additions & 7 deletions __tests__/find-haskell.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ import {getInput} from '@actions/core';
import * as supported_versions from '../src/versions.json';

const def = getDefaults();
const latestVersions = {
ghc: supported_versions.ghc[0],
cabal: supported_versions.cabal[0],
stack: supported_versions.stack[0]
};

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

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

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

it('"latest" Versions resolve correctly', () => {
const v = {ghc: '8.6.5', cabal: '2.4.1.0', stack: '2.1.3'};
setupEnv({
'stack-version': '2.1',
'ghc-version': '8.6',
'cabal-version': '2.4'
'stack-version': 'latest',
'ghc-version': 'latest',
'cabal-version': 'latest'
});
const options = getOpts(def);
forAll(t => expect(options[t].resolved).toBe(v[t]));
forAll(t => expect(options[t].resolved).toBe(latestVersions[t]));
});

it('Enabling stack does not disable GHC or Cabal', () => {
Expand Down
8 changes: 3 additions & 5 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2584,7 +2584,7 @@ function escapeProperty(s) {
/***/ 447:
/***/ (function(module) {

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"]};
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"]};

/***/ }),

Expand Down Expand Up @@ -10721,13 +10721,11 @@ exports.installTool = installTool;
async function stack(version, os) {
core.info(`Attempting to install stack ${version}`);
const build = {
linux: 'linux-x86_64-static',
linux: `linux-x86_64${version >= '2.3.1' ? '' : '-static'}`,
darwin: 'osx-x86_64',
win32: 'windows-x86_64'
}[os];
const url = version === 'latest'
? `https://get.haskellstack.org/stable/${build}.tar.gz`
: `https://github.com/commercialhaskell/stack/releases/download/v${version}/stack-${version}-${build}.tar.gz`;
const url = `https://github.com/commercialhaskell/stack/releases/download/v${version}/stack-${version}-${build}.tar.gz`;
const p = await tc.downloadTool(`${url}`).then(tc.extractTar);
const [stackPath] = await glob_1.create(`${p}/stack*`, {
implicitDescendants: false
Expand Down
7 changes: 2 additions & 5 deletions src/installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,12 @@ export async function installTool(
async function stack(version: string, os: OS): Promise<void> {
core.info(`Attempting to install stack ${version}`);
const build = {
linux: 'linux-x86_64-static',
linux: `linux-x86_64${version >= '2.3.1' ? '' : '-static'}`,
darwin: 'osx-x86_64',
win32: 'windows-x86_64'
}[os];

const url =
version === 'latest'
? `https://get.haskellstack.org/stable/${build}.tar.gz`
: `https://github.com/commercialhaskell/stack/releases/download/v${version}/stack-${version}-${build}.tar.gz`;
const url = `https://github.com/commercialhaskell/stack/releases/download/v${version}/stack-${version}-${build}.tar.gz`;
const p = await tc.downloadTool(`${url}`).then(tc.extractTar);
const [stackPath] = await glob(`${p}/stack*`, {
implicitDescendants: false
Expand Down
1 change: 1 addition & 0 deletions src/versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
],
"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",
Expand Down

0 comments on commit c1b48c3

Please sign in to comment.