on master help sign in
Fixed builds (?)
commita269ef48a1d0773c5205366502ecd068caca459c authoriko <ilyakooo0@gmail.com> dateTue 21 Dec 2021, 12:24 (5 years ago) parent79bf8c2
4 files changed+247−35
.github/workflows/github-actions-image.yaml+4−2 compaREST.cabal+218 comparest.cabal+8−16 default.nix+17−17
.github/workflows/github-actions-image.yaml+4−2
@@ -32,8 +32,9 @@ jobs:
3232 uses: ./.github/actions/common_setup
3333
3434 - name: Build Linux static binary
35+ shell: bash
3536 run: |
36− cp $(nix-build -A compaRESTStaticBin -j auto)/bin/comparest compaREST
37+ cp $(nix-build -A compaRESTStaticBin -j auto)/bin/compaREST compaREST
3738
3839 - name: Upload compaREST Linux Binary
3940 uses: actions/upload-artifact@v2
@@ -42,6 +43,7 @@ jobs:
4243 path: compaREST
4344
4445 - name: Build Github Action Docker Image
46+ shell: bash
4547 run: |
4648 cp $(nix-build -A compaRESTGithubAction -j auto) compaREST-Github-Action-image.tar.gz
4749 cp $(nix-build -A compaRESTImage-j auto) compaREST-image.tar.gz
@@ -90,7 +92,7 @@ jobs:
9092
9193 - name: Build macOS binary bundle
9294 run: |
93− cp -LR $(nix-build -A macOSCompaRESTBundle -j auto)/bin/compaREST compaREST
95+ cp -LR $(nix-build -A macOSCompaRESTBundle -j auto) compaREST
9496
9597 - name: Upload macOS compaREST bundle
9698 uses: actions/upload-artifact@v2
compaREST.cabalnew file+218
@@ -0,0 +1,218 @@
1+cabal-version: 2.4
2+name: compaREST
3+version: 0.0.0.0
4+synopsis: Compatibility checker for OpenAPI
5+description: Compatibility checker for OpenAPI.
6+license: MIT
7+license-file: LICENSE
8+author: Typeable
9+maintainer: compaREST@typeable.io
10+copyright: 2021 Typeable
11+category: Web
12+build-type: Simple
13+extra-doc-files: README.md
14+ CHANGELOG.md
15+tested-with: GHC == 8.10.4
16+extra-source-files: awsm-css/dist/awsm.min.css
17+
18+common common-options
19+ ghc-options:
20+ -Weverything
21+ -Wno-implicit-prelude
22+ -Wno-missing-safe-haskell-mode
23+ -Wno-safe
24+ -Wno-prepositive-qualified-module
25+ -Wno-missing-import-lists
26+ -Wno-partial-fields
27+ -Wno-all-missed-specialisations
28+ -Wno-missing-local-signatures
29+ -Wno-unsafe
30+ -fconstraint-solver-iterations=0
31+ default-language: Haskell2010
32+ build-depends: base >= 4.12.0.0 && < 4.16
33+ , text
34+
35+ default-extensions: ApplicativeDo
36+ , BangPatterns
37+ , ConstraintKinds
38+ , DataKinds
39+ , DeriveAnyClass
40+ , DeriveFoldable
41+ , DeriveFunctor
42+ , DeriveGeneric
43+ , DeriveTraversable
44+ , DerivingStrategies
45+ , DerivingVia
46+ , DuplicateRecordFields
47+ , EmptyDataDeriving
48+ , FlexibleContexts
49+ , FlexibleInstances
50+ , FunctionalDependencies
51+ , GADTs
52+ , GeneralizedNewtypeDeriving
53+ , LambdaCase
54+ , MultiParamTypeClasses
55+ , MultiWayIf
56+ , NamedFieldPuns
57+ , NumDecimals
58+ , OverloadedStrings
59+ , PatternSynonyms
60+ , PolyKinds
61+ , QuasiQuotes
62+ , RankNTypes
63+ , RecordWildCards
64+ , ScopedTypeVariables
65+ , StandaloneDeriving
66+ , TemplateHaskell
67+ , TupleSections
68+ , TypeApplications
69+ , TypeFamilies
70+ , TypeOperators
71+ , UndecidableInstances
72+ , ViewPatterns
73+ , QuantifiedConstraints
74+ , DefaultSignatures
75+
76+library
77+ import: common-options
78+ build-depends:
79+ , pcre2
80+ , open-union
81+ , vector
82+ , unordered-containers
83+ , type-fun
84+ , typerep-map
85+ , tagged
86+ , scientific
87+ , pandoc-types
88+ , openapi3
89+ , lattices
90+ , insert-ordered-containers
91+ , http-media
92+ , hashable
93+ , free
94+ , containers
95+ , comonad
96+ , attoparsec
97+ , transformers
98+ , mtl
99+ , aeson
100+ , generic-data
101+ , doctemplates
102+ , file-embed
103+ , data-default
104+ , ordered-containers
105+ , bytestring
106+ hs-source-dirs: src
107+ exposed-modules: Data.OpenApi.Compare.Behavior
108+ , Data.OpenApi.Compare.Common
109+ , Data.OpenApi.Compare.Formula
110+ , Data.OpenApi.Compare.Memo
111+ , Data.OpenApi.Compare.Orphans
112+ , Data.OpenApi.Compare.Paths
113+ , Data.OpenApi.Compare.PathsPrefixTree
114+ , Data.OpenApi.Compare.References
115+ , Data.OpenApi.Compare.Report
116+ , Data.OpenApi.Compare.Report.Html.Template
117+ , Data.OpenApi.Compare.Report.Jet
118+ , Data.OpenApi.Compare.Run
119+ , Data.OpenApi.Compare.Subtree
120+ , Data.OpenApi.Compare.Validate.Header
121+ , Data.OpenApi.Compare.Validate.Link
122+ , Data.OpenApi.Compare.Validate.MediaTypeObject
123+ , Data.OpenApi.Compare.Validate.OAuth2Flows
124+ , Data.OpenApi.Compare.Validate.OpenApi
125+ , Data.OpenApi.Compare.Validate.Operation
126+ , Data.OpenApi.Compare.Validate.Param
127+ , Data.OpenApi.Compare.Validate.PathFragment
128+ , Data.OpenApi.Compare.Validate.Products
129+ , Data.OpenApi.Compare.Validate.RequestBody
130+ , Data.OpenApi.Compare.Validate.Responses
131+ , Data.OpenApi.Compare.Validate.Schema
132+ , Data.OpenApi.Compare.Validate.Schema.DNF
133+ , Data.OpenApi.Compare.Validate.Schema.Issues
134+ , Data.OpenApi.Compare.Validate.Schema.JsonFormula
135+ , Data.OpenApi.Compare.Validate.Schema.Partition
136+ , Data.OpenApi.Compare.Validate.Schema.Process
137+ , Data.OpenApi.Compare.Validate.Schema.Traced
138+ , Data.OpenApi.Compare.Validate.Schema.TypedJson
139+ , Data.OpenApi.Compare.Validate.SecurityRequirement
140+ , Data.OpenApi.Compare.Validate.SecurityScheme
141+ , Data.OpenApi.Compare.Validate.Server
142+ , Data.OpenApi.Compare.Validate.Sums
143+ other-modules: Data.HList
144+ , Data.OpenUnion.Extra
145+
146+executable compaREST
147+ import: common-options
148+ hs-source-dirs: app
149+ main-is: Main.hs
150+ build-depends:
151+ compaREST
152+ , pandoc
153+ , data-default
154+ , bytestring
155+ , yaml
156+ , filepath
157+ , optparse-applicative
158+ , mtl
159+ , aeson
160+ , containers
161+ , doctemplates
162+ , pandoc-types
163+ ghc-options: -threaded
164+ -rtsopts
165+ -with-rtsopts=-N
166+ other-modules:
167+ FormatHeuristic
168+ Data.OpenApi.Compare.Options
169+
170+executable compaREST-GitHub-Action
171+ import: common-options
172+ hs-source-dirs: github-action
173+ main-is: Main.hs
174+ build-depends:
175+ compaREST
176+ , pandoc
177+ , yaml
178+ , aeson
179+ , github
180+ , freer-simple
181+ , vector
182+ , pandoc-types
183+ , envy
184+ , filepath
185+ , bytestring
186+ ghc-options: -threaded
187+ -rtsopts
188+ -with-rtsopts=-N
189+ other-modules:
190+ Control.Monad.Freer.GitHub
191+ CompaREST.GitHub.API
192+ CompaREST.GitHub.Action.Config
193+ GitHub.Data.Checks
194+ GitHub.Endpoints.Checks
195+
196+test-suite compaREST-tests
197+ import: common-options
198+ type: exitcode-stdio-1.0
199+ hs-source-dirs: test
200+ main-is: Spec.hs
201+ other-modules:
202+ Spec.Golden.Extra
203+ Spec.Golden.TraceTree
204+ build-depends:
205+ , compaREST
206+ , tasty-golden
207+ , tasty
208+ , bytestring
209+ , yaml
210+ , directory
211+ , filepath
212+ , pandoc
213+ , data-default
214+ , lens
215+ , pandoc-types
216+ ghc-options: -threaded
217+ -rtsopts
218+ -with-rtsopts=-N
comparest.cabal+8−16
@@ -1,12 +1,12 @@
11cabal-version: 2.4
2−name: comparest
2+name: compaREST
33version: 0.0.0.0
44synopsis: Compatibility checker for OpenAPI
55description: Compatibility checker for OpenAPI.
66license: MIT
77license-file: LICENSE
88author: Typeable
9−maintainer: comparest@typeable.io
9+maintainer: compaREST@typeable.io
1010copyright: 2021 Typeable
1111category: Web
1212build-type: Simple
@@ -15,15 +15,7 @@ extra-doc-files: README.md
1515tested-with: GHC == 8.10.4
1616extra-source-files: awsm-css/dist/awsm.min.css
1717
18−Flag static
19− Default: False
20− Manual: True
21−
2218common common-options
23− if flag(static)
24− cc-options: -static
25− ld-options: -static -pthread
26− ghc-options: -static
2719 ghc-options:
2820 -Weverything
2921 -Wno-implicit-prelude
@@ -151,12 +143,12 @@ library
151143 other-modules: Data.HList
152144 , Data.OpenUnion.Extra
153145
154−executable comparest
146+executable compaREST
155147 import: common-options
156148 hs-source-dirs: app
157149 main-is: Main.hs
158150 build-depends:
159− comparest
151+ compaREST
160152 , pandoc
161153 , data-default
162154 , bytestring
@@ -175,12 +167,12 @@ executable comparest
175167 FormatHeuristic
176168 Data.OpenApi.Compare.Options
177169
178−executable comparest-github-action
170+executable compaREST-GitHub-Action
179171 import: common-options
180172 hs-source-dirs: github-action
181173 main-is: Main.hs
182174 build-depends:
183− comparest
175+ compaREST
184176 , pandoc
185177 , yaml
186178 , aeson
@@ -201,7 +193,7 @@ executable comparest-github-action
201193 GitHub.Data.Checks
202194 GitHub.Endpoints.Checks
203195
204−test-suite comparest-tests
196+test-suite compaREST-tests
205197 import: common-options
206198 type: exitcode-stdio-1.0
207199 hs-source-dirs: test
@@ -210,7 +202,7 @@ test-suite comparest-tests
210202 Spec.Golden.Extra
211203 Spec.Golden.TraceTree
212204 build-depends:
213− , comparest
205+ , compaREST
214206 , tasty-golden
215207 , tasty
216208 , bytestring
default.nix+17−17
@@ -14,7 +14,7 @@ let
1414 include = [
1515 ./stack.yaml
1616 ./stack.yaml.lock
17− ./comparest.cabal
17+ ./compaREST.cabal
1818 ];
1919 };
2020
@@ -29,11 +29,11 @@ let
2929 "-fspecialise-aggressively"
3030 ];
3131 packages.pandoc.ghcOptions = [ "-O1" ];
32− packages.comparest.src = nix-filter {
32+ packages.compaREST.src = nix-filter {
3333 root = ./.;
3434 name = "compaREST-src";
3535 include = with nix-filter; [
36− (./comparest.cabal)
36+ (./compaREST.cabal)
3737 (inDirectory ./test)
3838 (inDirectory ./src)
3939 (inDirectory ./app)
@@ -53,30 +53,30 @@ let
5353 ${pkgs.nukeReferences}/bin/nuke-refs $out/bin/*
5454 '';
5555
56− compaRESTBin = hsPkgs.comparest.components.exes.comparest;
57− compaRESTStaticBin = (staticify "compaREST-static" hsPkgs.projectCross.musl64.hsPkgs.comparest.components.exes.comparest);
56+ compaRESTBin = hsPkgs.compaREST.components.exes.compaREST;
57+ compaRESTStaticBin = (staticify "compaREST-static" hsPkgs.projectCross.musl64.hsPkgs.compaREST.components.exes.compaREST);
5858
5959
6060 # doesn't work
61− armDarwinCompaREST = hsPkgs.projectCross.aarch64-darwin.hsPkgs.comparest.components.exes.comparest;
61+ armDarwinCompaREST = hsPkgs.projectCross.aarch64-darwin.hsPkgs.compaREST.components.exes.compaREST;
6262
6363 compaRESTImage = pkgs.dockerTools.buildImage {
6464 name = "compaREST";
6565 contents = [ compaRESTStaticBin ];
6666 config = {
67− Entrypoint = [ "/bin/comparest" ];
67+ Entrypoint = [ "/bin/compaREST" ];
6868 };
6969 };
7070
71− macOSCompaRESTBundle = pkgs.runCommand "compaREST-macos-bundled"
71+ macOSCompaRESTBundle = pkgs.runCommand "compaREST-macOS-bundled"
7272 {
7373 buildInputs = [ masterPkgs.macdylibbundler ];
7474 } ''
7575 mkdir -p $out/lib
76− cp ${compaRESTBin}/bin/comparest $out/comparest
77− chmod 755 $out/comparest
76+ cp ${compaRESTBin}/bin/compaREST $out/compaREST
77+ chmod 755 $out/compaREST
7878 dylibbundler -b \
79− -x $out/comparest \
79+ -x $out/compaREST \
8080 -d $out/lib \
8181 -p '@executable_path/lib'
8282 '';
@@ -84,19 +84,19 @@ let
8484
8585 compaRESTGithubAction =
8686 let
87− action = staticify "compaREST-github-action-static" hsPkgs.projectCross.musl64.hsPkgs.comparest.components.exes.comparest-github-action;
87+ action = staticify "compaREST-github-action-static" hsPkgs.projectCross.musl64.hsPkgs.compaREST.components.exes.compaREST-github-action;
8888 wrapped = pkgs.runCommand "wrapped-compaREST-github-action" { buildInputs = [ pkgs.makeWrapper ]; } ''
89− makeWrapper ${action}/bin/comparest-github-action $out/bin/pre --add-flags "pre"
90− makeWrapper ${action}/bin/comparest-github-action $out/bin/run --add-flags "run"
89+ makeWrapper ${action}/bin/compaREST-github-action $out/bin/pre --add-flags "pre"
90+ makeWrapper ${action}/bin/compaREST-github-action $out/bin/run --add-flags "run"
9191 '';
9292 in
9393 pkgs.dockerTools.buildImage {
94− name = "typeable/comparest-github-action";
94+ name = "typeable/compaREST-GitHub-Action";
9595 tag = "latest";
9696 contents = [ wrapped pkgs.cacert ];
9797 };
9898
99− WindowsCompaRESTBin = hsPkgs.projectCross.mingwW64.hsPkgs.comparest.components.exes.comparest;
99+ WindowsCompaRESTBin = hsPkgs.projectCross.mingwW64.hsPkgs.compaREST.components.exes.compaREST;
100100in
101101{
102102 inherit compaRESTImage
@@ -107,5 +107,5 @@ in
107107 macOSCompaRESTBundle
108108 WindowsCompaRESTBin
109109 ;
110− test = hsPkgs.comparest.components.tests.comparest-tests;
110+ test = hsPkgs.compaREST.components.tests.compaREST-tests;
111111}