Skip to content

Test

Test #703

Workflow file for this run

name: "Test"
concurrency:
group: ${{ github.workflow }} ${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
on:
pull_request: {}
push:
branches:
- master
schedule:
# every day at midnight, to test against non-pinned versions in the matrix
- cron: '0 0 * * *'
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
kongVersion:
- "3.4.x"
- "stable"
- "dev"
- "2.8.x.x"
- "3.4.x.x"
- "stable-ee"
- "dev-ee"
steps:
- uses: actions/checkout@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
# login to docker to prevent hitting rate-limits etc
with:
username: ${{ secrets.GHA_DOCKERHUB_PULL_USER }}
password: ${{ secrets.GHA_KONG_ORG_DOCKERHUB_PUBLIC_TOKEN }}
- uses: Kong/kong-license@master
# this step is only for Kong Inc internal uses, external users should
# use the 'license' parameter of the kong-pongo action.
with:
op-token: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
- uses: Kong/kong-pongo-action@v1
with:
pongo_version: master
kong_version: ${{ matrix.kongVersion }}
# Non-Kong-Inc users should provide their Enterprise license as a secret
# if testing against Enterprise versions.
# Kong Inc users should use the `Kong/kong-license` action, and remove this
license: ${{ secrets.KONG_LICENSE_DATA }}
# the following entry is only for Kong Inc internal use to test against
# the Kong Enterprise development images, external users should
# delete this.
# github token with permissions to clone the kong-ee repo
github_token: ${{ secrets.GHA_KONG_BOT_READ_TOKEN }}
- run: pongo run -- --Xoutput "--color" --coverage
# Optional upload of coverage data,
# just ugly, something to fix...
- uses: leafo/gh-actions-lua@v10
if: success()
- uses: leafo/gh-actions-luarocks@v4
if: success()
- name: Report test coverage
if: success()
continue-on-error: true
run: |
luarocks install luacov-coveralls
# hack: luacov config file has a path for inside the pongo container
# rewrite those to the local location in GHA
if [ -f .luacov ]; then
cp .luacov .luacov_backup
cat .luacov_backup | sed 's/\/kong-plugin\/luacov./luacov./' > .luacov
fi
rm *.report.out
luacov-coveralls
#luacov-coveralls --output coveralls.out
# undo the hack
if [ -f .luacov_backup ]; then
mv .luacov_backup .luacov
fi
env:
COVERALLS_REPO_TOKEN: ${{ github.token }}