name: Busted

on: [push, pull_request]

jobs:

  busted:
    strategy:
      fail-fast: false
      matrix:
        luaVersion: ["5.4", "5.3", "5.2", "5.1", "luajit", "luajit-openresty"]
        penlightVersion: ["1.9.2", "1.8.0", "1.6.0", "1.3.2"]
    runs-on: ubuntu-20.04
    steps:
    - name: Checkout
      uses: actions/checkout@v2
    - name: Setup ‘lua’
      uses: leafo/gh-actions-lua@v8
      with:
        luaVersion: ${{ matrix.luaVersion }}
    - name: Setup ‘luarocks’
      uses: leafo/gh-actions-luarocks@v4
    - name: Setup dependencies
      run: |
        luarocks install penlight ${{ matrix.penlightVersion }}
        luarocks install --only-deps busted-scm-2.rockspec
        luarocks install luasec
        luarocks install moonscript
    - name: Build
      run: luarocks make
    - name: Run tests
      run: busted -v

name: Busted

on: [push, pull_request]

jobs:

  busted:
    strategy:
      fail-fast: false
      matrix:
        luaVersion: ["5.4", "5.3", "5.2", "5.1", "luajit", "luajit-openresty"]
        penlightVersion: ["1.9.2", "1.8.0", "1.6.0", "1.3.2"]
    runs-on: ubuntu-20.04
    steps:
    - name: Checkout
      uses: actions/checkout@v2
    - name: Setup ‘lua’
      uses: leafo/gh-actions-lua@v8
      with:
        luaVersion: ${{ matrix.luaVersion }}
    - name: Setup ‘luarocks’
      uses: leafo/gh-actions-luarocks@v4
    - name: Setup dependencies
      run: |
        luarocks install penlight ${{ matrix.penlightVersion }}
        luarocks install --only-deps busted-scm-2.rockspec
        luarocks install luasec
        luarocks install moonscript
    - name: Cache Lua machinery
      uses: actions/cache@v2
      with:
        path: |
          .install
          .lua
          .luarocks
        key: lua-${{ matrix.luaVersion }}-${{ matrix.penlightVersion }}-${{ hashFiles('busted-scm-2.rockspec', '.github/workflows/busted.yml') }}
    - name: Build
      run: luarocks make
    - name: Run tests
      run: busted -v

Add caching of Lua environment to CI run
Add caching of Lua environment to CI run
