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 4343 - name : Build the project
4444 run : npm run build
4545
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+
4649 - name : Run tests
47- run : npm run test
50+ uses : ./ test
Original file line number Diff line number Diff line change 55 "test" : " spago test --no-install"
66 },
77 "devDependencies" : {
8+ "@vercel/ncc" : " ^0.24.1" ,
89 "eslint" : " ^7.6.0"
910 },
1011 "dependencies" : {
Original file line number Diff line number Diff line change @@ -49,9 +49,9 @@ exports.cacheFile4Impl = toolCache.cacheFile;
4949
5050exports . cacheFile5Impl = toolCache . cacheFile ;
5151
52- exports . find2Impl = toolCache . findImpl ;
52+ exports . find2Impl = toolCache . find ;
5353
54- exports . find3Impl = toolCache . findImpl ;
54+ exports . find3Impl = toolCache . find ;
5555
5656exports . findAllVersions1Impl = toolCache . findAllVersions ;
5757
Original file line number Diff line number Diff line change @@ -2,7 +2,21 @@ module Test.Main where
22
33import Prelude
44
5+ import Control.Monad.Except.Trans (runExceptT )
6+ import Data.Either (Either (..))
7+ import Data.Maybe (Maybe (..))
58import Effect (Effect )
9+ import Effect.Exception (message )
10+ import GitHub.Actions.Core as Core
11+ import GitHub.Actions.ToolCache as ToolCache
612
713main :: 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