Skip to content

Remove luarocks debug command #109

Remove luarocks debug command

Remove luarocks debug command #109

Workflow file for this run

---
name: 'Test everything'
on:
push:
pull_request:
schedule:
# Once per month check it's still working
- cron: '0 22 1 * *'
jobs:
test_all:
name: test_all
env:
LUAROCKS: 3.11.1
ES_USERNAME: elastic
ES_PASSWORD: "Changeme12456!"
ES_TEST_PROTOCOL: http
ES_TEST_PORT: 9200
CACERT_PATH:
ELASTIC_CREDS:
PROTOCOL: HTTP
strategy:
fail-fast: false
matrix:
# We test on four versions of Lua
lua: [lua5.1, lua5.2, lua5.3, lua5.4, luajit]
# We're testing on three versions of Elastic: 7, 8 and the
# Amazon Fork - OpenSearch 2.0
elastic: [el7, el8, os2]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 6
submodules: recursive
- name: Set dynamic env vars
run: echo "CAFILE=$GITHUB_WORKSPACE/docker/certs/ca/ca.crt" >> $GITHUB_ENV
- name: Set Certfile Path for el8
if: ${{ matrix.elastic == 'el8' }}
run: echo "CACERT_PATH=--cacert $GITHUB_WORKSPACE/docker/certs/ca/ca.crt" >> $GITHUB_ENV
- name: install dependencies
run: sudo apt-get -y update && sudo apt-get install wget openssl -y
- name: run elasticsearch
run: cd docker && docker compose -f create-certs.yml up && cp docker-compose.yml.${{ matrix.elastic }} docker-compose.yml && docker compose up -d && cd ..
- name: output docker compose logs if the previous step failed
if: failure()
run: cd docker && docker compose logs && cd ..
- name: setup test environment
env:
LUA: ${{ matrix.lua }}
run: source tests/gh_actions/setenv_lua.sh
- name: Add lua things to path
run: echo "$HOME/.lua:$HOME/.local/bin:$GITHUB_WORKSPACE/install/luarocks/bin" >> $GITHUB_PATH
- name: install luarocks
run: luarocks install lunitx && luarocks install luacov && luarocks install luacov-coveralls && luarocks install luasec 0.7-1
- name: make the elasticsearch-lua rockspec
run: luarocks make rockspecs/elasticsearch-lua-1.0.12-1.rockspec
- name: run the tests for el8
if: ${{ matrix.elastic == 'el8' }}
env:
ES_TEST_PROTOCOL: https
ES_TEST_PORT: 19200
ELASTIC_CREDS: -u ${{env.ES_USERNAME}}:${{env.ES_PASSWORD}}
PROTOCOL: https
run: cd tests && luarocks path >lpath.sh && source lpath.sh && lua run-tests.lua
- name: run the tests for opensearch2
if: ${{ matrix.elastic == 'os2' }}
env:
ES_TEST_PORT: 29200
run: cd tests && luarocks path >lpath.sh && source lpath.sh && lua run-tests.lua
- name: run the tests for el7
if: ${{ matrix.elastic == 'el7' }}
run: cd tests && luarocks path >lpath.sh && source lpath.sh && lua run-tests.lua