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

Commit 2bb8480

Browse files
authored
Merge pull request #12 from haskell-CI/master
Add Windows, macOS, and Stack Support (#1)
2 parents 39f6060 + 9bd8f8d commit 2bb8480

File tree

201 files changed

+16568
-16115
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

201 files changed

+16568
-16115
lines changed

.eslintignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
dist/
2+
.out/
3+
__tests__/
4+
node_modules/

.eslintrc.json

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{
2+
"root": true,
3+
"plugins": ["jest", "@typescript-eslint"],
4+
"extends": ["plugin:github/es6"],
5+
"parser": "@typescript-eslint/parser",
6+
"parserOptions": {
7+
"ecmaVersion": 2019,
8+
"sourceType": "module",
9+
"project": "./tsconfig.json"
10+
},
11+
"rules": {
12+
"eslint-comments/no-use": "off",
13+
"import/no-namespace": "off",
14+
"no-unused-vars": "off",
15+
"@typescript-eslint/no-unused-vars": "error",
16+
"@typescript-eslint/explicit-member-accessibility": [
17+
"warn",
18+
{"accessibility": "no-public"}
19+
],
20+
"@typescript-eslint/no-require-imports": "error",
21+
"@typescript-eslint/array-type": "warn",
22+
"@typescript-eslint/await-thenable": "error",
23+
"@typescript-eslint/ban-ts-ignore": "error",
24+
"camelcase": "off",
25+
"@typescript-eslint/explicit-function-return-type": [
26+
"warn",
27+
{"allowExpressions": true}
28+
],
29+
"@typescript-eslint/no-array-constructor": "error",
30+
"@typescript-eslint/no-empty-interface": "warn",
31+
"@typescript-eslint/no-explicit-any": "warn",
32+
"@typescript-eslint/no-for-in-array": "error",
33+
"@typescript-eslint/no-misused-new": "warn",
34+
"@typescript-eslint/no-namespace": "warn",
35+
"@typescript-eslint/no-non-null-assertion": "warn",
36+
"@typescript-eslint/no-unnecessary-qualifier": "warn",
37+
"@typescript-eslint/no-unnecessary-type-assertion": "warn",
38+
"@typescript-eslint/no-useless-constructor": "warn",
39+
"@typescript-eslint/no-var-requires": "error",
40+
"@typescript-eslint/prefer-for-of": "warn",
41+
"@typescript-eslint/prefer-function-type": "warn",
42+
"@typescript-eslint/prefer-includes": "warn",
43+
"@typescript-eslint/prefer-string-starts-ends-with": "warn",
44+
"@typescript-eslint/promise-function-async": "warn",
45+
"@typescript-eslint/require-array-sort-compare": "warn",
46+
"@typescript-eslint/restrict-plus-operands": "error",
47+
"semi": "off",
48+
"@typescript-eslint/unbound-method": "error",
49+
"prettier/prettier": "off"
50+
},
51+
"env": {
52+
"node": true,
53+
"es6": true,
54+
"jest/globals": true
55+
}
56+
}

.github/workflows/workflow.yml

Lines changed: 61 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,71 @@ on:
99
paths-ignore:
1010
- '**.md'
1111
jobs:
12-
run:
13-
name: Run
14-
runs-on: ${{ matrix.operating-system }}
12+
test:
13+
name: Unit Tests - ${{ matrix.os }}
14+
runs-on: ${{ matrix.os }}
1515
strategy:
16+
fail-fast: false
1617
matrix:
17-
operating-system: [ubuntu-latest, windows-latest]
18+
os: [ubuntu-latest, macOS-latest, windows-latest]
1819
steps:
19-
- name: Checkout
20-
uses: actions/checkout@v2
20+
- name: Checkout
21+
uses: actions/checkout@v2
2122

22-
- name: Set Node.js 12
23-
uses: actions/setup-node@v1
24-
with:
25-
node-version: 12
23+
- name: Set Node.js 12
24+
uses: actions/setup-node@v1
25+
with:
26+
node-version: 12
27+
# http://www.tiernok.com/posts/2019/faster-npm-installs-during-ci/
28+
- run: npm ci --prefer-offline --no-audit --progress=false
29+
- run: npm test
2630

27-
- name: npm install
28-
run: npm install
31+
install-haskell:
32+
name: GHC ${{ matrix.ghc }}, Cabal ${{ matrix.cabal }} - ${{ matrix.os }}
33+
runs-on: ${{ matrix.os }}
34+
strategy:
35+
fail-fast: false
36+
matrix:
37+
os: [ubuntu-latest, macOS-latest, windows-latest]
38+
ghc: ['8.8', '8.4.4']
39+
cabal: ['3.0.0.0']
40+
include:
41+
- os: ubuntu-latest
42+
ghc: '7.10.3'
43+
cabal: '3.0.0.0'
44+
45+
steps:
46+
- uses: actions/checkout@v2
47+
- uses: ./
48+
with:
49+
ghc-version: ${{ matrix.ghc }}
50+
cabal-version: ${{ matrix.cabal }}
51+
- run: |
52+
runhaskell --version
53+
runhaskell __tests__/hello.hs
54+
- shell: bash
55+
run: cd __tests__/project && cabal build && cabal run
56+
- run: |
57+
cabal --version
58+
ghc --version
2959
30-
- name: Lint
31-
run: npm run format-check
60+
install-stack:
61+
name: Stack ${{ matrix.stack }} ${{ matrix.os }}
62+
runs-on: ${{ matrix.os }}
63+
strategy:
64+
fail-fast: false
65+
matrix:
66+
os: [ubuntu-latest, macOS-latest, windows-latest]
67+
stack: ['latest', '1.9.1']
68+
69+
steps:
70+
- uses: actions/checkout@v2
3271

33-
- name: npm test
34-
run: npm test
72+
- uses: ./
73+
with:
74+
enable-stack: true
75+
stack-no-global: true
76+
stack-version: ${{ matrix.stack }}
77+
- run: |
78+
stack --version
79+
stack

.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
!node_modules/
2-
__tests__/runner/*
1+
node_modules
2+
dist-newstyle
3+
.out
4+
.eslintcache

.lintstagedrc.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
'!(*test).{js,ts}': 'eslint --cache --fix',
3+
'!(*test).ts': () => ['ncc build', 'git add dist'],
4+
'src/**/*.ts': () => 'tsc -p tsconfig.json',
5+
'*.{js,ts,json,md}': 'prettier --write'
6+
};

.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dist/
2+
.out/
3+
node_modules/

.prettierrc.json

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
{
2-
"printWidth": 80,
3-
"tabWidth": 2,
4-
"useTabs": false,
5-
"semi": true,
6-
"singleQuote": true,
7-
"trailingComma": "none",
8-
"bracketSpacing": false,
9-
"arrowParens": "avoid",
10-
"parser": "typescript"
11-
}
2+
"printWidth": 80,
3+
"tabWidth": 2,
4+
"useTabs": false,
5+
"semi": true,
6+
"singleQuote": true,
7+
"trailingComma": "none",
8+
"bracketSpacing": false,
9+
"arrowParens": "avoid"
10+
}

0 commit comments

Comments
 (0)