File tree Expand file tree Collapse file tree 6 files changed +32
-4
lines changed Expand file tree Collapse file tree 6 files changed +32
-4
lines changed Original file line number Diff line number Diff line change 43
43
- name : Build the project
44
44
run : npm run build
45
45
46
+ - name : Build and bundle tests
47
+ run : spago bundle-module --main Test.Main --to output/index.js && ./node_modules/@vercel/ncc/dist/ncc/cli.js build --minify test/index.js
48
+
46
49
- name : Run tests
47
- run : npm run test
50
+ uses : ./ test
Original file line number Diff line number Diff line change 5
5
"test" : " spago test --no-install"
6
6
},
7
7
"devDependencies" : {
8
+ "@vercel/ncc" : " ^0.24.1" ,
8
9
"eslint" : " ^7.6.0"
9
10
},
10
11
"dependencies" : {
Original file line number Diff line number Diff line change @@ -49,9 +49,9 @@ exports.cacheFile4Impl = toolCache.cacheFile;
49
49
50
50
exports . cacheFile5Impl = toolCache . cacheFile ;
51
51
52
- exports . find2Impl = toolCache . findImpl ;
52
+ exports . find2Impl = toolCache . find ;
53
53
54
- exports . find3Impl = toolCache . findImpl ;
54
+ exports . find3Impl = toolCache . find ;
55
55
56
56
exports . findAllVersions1Impl = toolCache . findAllVersions ;
57
57
Original file line number Diff line number Diff line change @@ -2,7 +2,21 @@ module Test.Main where
2
2
3
3
import Prelude
4
4
5
+ import Control.Monad.Except.Trans (runExceptT )
6
+ import Data.Either (Either (..))
7
+ import Data.Maybe (Maybe (..))
5
8
import Effect (Effect )
9
+ import Effect.Exception (message )
10
+ import GitHub.Actions.Core as Core
11
+ import GitHub.Actions.ToolCache as ToolCache
6
12
7
13
main :: Effect Unit
8
- main = pure unit
14
+ main = do
15
+ Core .info " Starting test action..."
16
+ result <- runExceptT do
17
+ _ <- ToolCache .find' { toolName: " my-tool" , versionSpec: " 12.x" }
18
+ ToolCache .find { toolName: " my-tool" , versionSpec: " 12.x" , arch: Just " armv6" }
19
+ case result of
20
+ Left err -> Core .setFailed (message err)
21
+ Right _ -> Core .info " No errors in find"
22
+ Core .info " Done running test action."
Original file line number Diff line number Diff line change
1
+ name : ' Test'
2
+ description : ' Test out bindings in this library'
3
+ runs :
4
+ using : ' node12'
5
+ main : ' ../dist/index.js'
Original file line number Diff line number Diff line change
1
+ "use strict" ;
2
+
3
+ var Test = require ( "../output/index" ) ;
4
+
5
+ Test . main ( ) ;
You can’t perform that action at this time.
0 commit comments