# Install and run unit tests with busted # Docs: http://olivinelabs.com/busted/ name: Nginx Lua Unit Tests on: push: branches: - "master" paths: - ".github/workflows/nginx-lua-unit-tests.yml" - "docker/nginx/libs/**.lua" pull_request: paths: - ".github/workflows/nginx-lua-unit-tests.yml" - "docker/nginx/libs/**.lua" jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 with: python-version: "3.x" architecture: "x64" - name: Install Dependencies run: | pip install hererocks hererocks env --lua=5.1 -rlatest source env/bin/activate luarocks install busted luarocks install luacov luarocks install hasher luarocks install luacheck - name: Lint code run: | source env/bin/activate luacheck docker/nginx/libs --std ngx_lua+busted - name: Unit Tests run: | source env/bin/activate busted --verbose --coverage --pattern=spec --directory=docker/nginx/libs . cd docker/nginx/libs && luacov - uses: codecov/codecov-action@v2 with: directory: docker/nginx/libs flags: nginx-lua