Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
head.hackage
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ellie Hermaszewska
head.hackage
Commits
5807fa21
Commit
5807fa21
authored
5 years ago
by
Ben Gamari
Browse files
Options
Downloads
Patches
Plain Diff
ci: Add support for providing additional tested packages on command-line
parent
4aa3f955
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ci/TestPatches.hs
+17
-0
17 additions, 0 deletions
ci/TestPatches.hs
with
17 additions
and
0 deletions
ci/TestPatches.hs
+
17
−
0
View file @
5807fa21
...
...
@@ -60,6 +60,7 @@ data Config = Config { configPatchDir :: FilePath
,
configOnlyPackages
::
Maybe
(
S
.
Set
Cabal
.
PackageName
)
,
configConcurrency
::
Int
,
configExtraCabalFragments
::
[
FilePath
]
,
configExtraPackages
::
[(
Cabal
.
PackageName
,
Version
)]
,
configExpectedBrokenPkgs
::
BrokenPackages
}
...
...
@@ -79,6 +80,7 @@ config =
<*>
onlyPackages
<*>
concurrency
<*>
extraCabalFragments
<*>
extraPackages
<*>
expectedBrokenPkgs
where
patchDir
=
option
str
(
short
'p'
<>
long
"patches"
<>
help
"patch directory"
<>
value
"./patches"
)
...
...
@@ -90,12 +92,26 @@ config =
<|>
pure
Nothing
concurrency
=
option
auto
(
short
'j'
<>
long
"concurrency"
<>
value
1
<>
help
"number of concurrent builds"
)
extraCabalFragments
=
many
$
option
str
(
long
"extra-cabal-fragment"
<>
help
"path of extra configuration to include in cabal project files"
)
extraPackages
=
many
$
option
pkgVer
(
short
'P'
<>
long
"extra-package"
<>
help
"other, un-patched packages to test"
)
expectedBrokenPkgs
=
fmap
(
BrokenPackages
.
S
.
fromList
)
$
many
$
option
(
fmap
toPkgName
pkgName
)
(
short
'b'
<>
long
"expect-broken"
<>
metavar
"PKGNAME"
<>
help
"expect the given package to fail to build"
)
pkgVer
::
ReadM
(
Cabal
.
PackageName
,
Version
)
pkgVer
=
str
>>=
parse
.
T
.
pack
where
parse
s
|
[
name
,
ver
]
<-
T
.
splitOn
"=="
s
,
Just
ver'
<-
simpleParse
$
T
.
unpack
ver
=
pure
(
Cabal
.
mkPackageName
$
T
.
unpack
name
,
ver'
)
|
otherwise
=
fail
$
unlines
[
"Invalid extra package specified:"
,
"expected to be in form of PKG_NAME==VERSION"
]
pkgName
::
ReadM
Cabal
.
PackageName
pkgName
=
str
>>=
maybe
(
fail
"invalid package name"
)
pure
.
simpleParse
...
...
@@ -103,6 +119,7 @@ testPatches :: Config -> IO ()
testPatches
cfg
=
do
setup
cfg
packages
<-
findPatchedPackages
(
configPatchDir
cfg
)
packages
<-
return
(
packages
++
configExtraPackages
cfg
)
let
packages'
::
S
.
Set
(
Cabal
.
PackageName
,
Version
)
packages'
|
Just
only
<-
configOnlyPackages
cfg
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment