leafo / gh-actions-lua

GitHub action for Lua/LuaJIT
85 stars 27 forks source link

how to run my lua file #18

Closed ZAA03 closed 3 years ago

ZAA03 commented 3 years ago

The Full Example have a little problem. And I use your github action,always show lua: cannot open **.lua: No such file or directory like this

name: test 
   on: [push] 
   jobs: 
 test: 
 runs-on: ubuntu-latest 
   steps: 
   - uses: leafo/gh-actions-lua@v8 
 with: 
 luaVersion: "5.1.5" 
 #5.1.5 
   - uses: leafo/gh-actions-luarocks@v4 

 - name:  install package
 run: | 
 luarocks install luasocket 
 luarocks install dkjson 
 luarocks install md5 

 - name: print package version
 run: | 
 lua -e 'http = require ("socket.http") print(socket._VERSION)' 
 lua -e 'md5 = require "md5" print(md5._VERSION)' 

#---------------------------------------------------------------
   - name: Run 
 run: | 
         pwd 
         lua ./***.lua                            #←----  Error in here!!
#---------------------------------------------------------------

It will show lua: cannot open **.lua: No such file or directory Run is error How can I solve this problem?

Ismoh commented 2 years ago

How did you solve this?

leafo commented 2 years ago

@Ismoh lua is added to the path so in order to run your lua file you just need to be sure you provide a correct path to a lua script, eg. lua myscript.lua

The issue opener had an issue because they didn't provide a correct path to a lua script, so the lua interpreter threw an error.

Ismoh commented 2 years ago

Ah, I didnt understand at first spot. I thought I was able to define a lua 'installation' in my workspace. I am using a custom build lua51.dll and would like to use it, instead of any of lua ftps ones. Is this possible? Should I create a new issue?