Skip to content

Commit 6bd2fee

Browse files
Merge pull request #57 from docopt/add-ci
Add CI
2 parents 54ce31b + b62850c commit 6bd2fee

19 files changed

Lines changed: 389 additions & 54 deletions

.ci/all_check.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/usr/bin/env python3
2+
"""
3+
Makes sure:
4+
* All jobs are listed in the 'all' job
5+
* Only existing tests are listed
6+
"""
7+
8+
import sys
9+
import yaml
10+
11+
CI_PATH = '.github/workflows/ci.yaml'
12+
ALL_TEST = 'all'
13+
14+
15+
def main():
16+
ci_yaml_fp = open(CI_PATH, 'r')
17+
ci_yaml_parsed = yaml.load(ci_yaml_fp, Loader=yaml.FullLoader)
18+
19+
all_jobs = set(ci_yaml_parsed['jobs'].keys()) - {ALL_TEST}
20+
all_needs = set(ci_yaml_parsed['jobs'][ALL_TEST]['needs'])
21+
22+
if all_jobs - all_needs:
23+
sys.exit(f'Not all jobs mentioned in {ALL_TEST}.needs: '
24+
f'{all_jobs - all_needs}')
25+
26+
if all_needs - all_jobs:
27+
sys.exit(f'Non-existing jobs found in {ALL_TEST}.needs: '
28+
f'{all_needs - all_jobs}')
29+
30+
31+
if __name__ == '__main__':
32+
main()

.ci/cabal.project.local

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
package docopt
2+
ghc-options: -Werror

.ci/cabal.project.local-lower

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package docopt
2+
ghc-options: -Werror
3+
4+
prefer-oldest: True
5+
6+
constraints:
7+
aeson >= 1.4.4.0,
8+
contravariant >= 1.5.2

.ci/cabal.project.local-upper

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
package docopt
2+
ghc-options: -Werror
3+
4+
repository head.hackage.ghc.haskell.org
5+
url: https://ghc.gitlab.haskell.org/head.hackage/
6+
secure: True
7+
key-threshold: 3
8+
root-keys:
9+
7541f32a4ccca4f97aea3b22f5e593ba2c0267546016b992dfadcd2fe944e55d
10+
26021a13b401500c8eb2761ca95c61f2d625bfef951b939a8124ed12ecf07329
11+
f76d08be13e9a61a377a85e2fb63f4c5435d40f8feb3e12eb05905edb8cdea89
12+
13+
active-repositories: hackage.haskell.org, head.hackage.ghc.haskell.org
14+
15+
-- HEAD.hackage standard allow-newer packages
16+
allow-newer:
17+
Cabal,
18+
base,
19+
binary,
20+
bytestring,
21+
deepseq,
22+
ghc,
23+
ghc-bignum,
24+
ghc-prim,
25+
integer-gmp,
26+
template-haskell,
27+
text,
28+
time
29+
30+
-- Boot packages
31+
constraints:
32+
base installed,
33+
ghc installed,
34+
ghc-bignum installed,
35+
ghc-prim installed,
36+
integer-gmp installed,
37+
template-haskell installed

.ci/stack-8.10.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
resolver: lts-18.28
2+
ghc-options:
3+
"$locals": -Werror -Wall -Wcompat -Wno-name-shadowing

.ci/stack-8.8.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
resolver: lts-16.31
2+
ghc-options:
3+
"$locals": -Werror -Wall -Wcompat -Wno-name-shadowing

.ci/stack-9.0.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
resolver: lts-19.33
2+
ghc-options:
3+
"$locals": -Werror -Wall -Wcompat -Wno-name-shadowing

.ci/stack-9.2.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
resolver: lts-20.26
2+
ghc-options:
3+
"$locals": -Werror -Wall -Wcompat -Wno-name-shadowing

.ci/stack-9.4.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
resolver: lts-21.14
2+
ghc-options:
3+
"$locals": -Werror -Wall -Wcompat -Wno-name-shadowing

.ci/stack-9.6.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
resolver: lts-22.11
2+
ghc-options:
3+
"$locals": -Werror -Wall -Wcompat -Wno-name-shadowing

0 commit comments

Comments
 (0)