Skip to content

build: Add smoke test to CI test action and added new release action #37

build: Add smoke test to CI test action and added new release action

build: Add smoke test to CI test action and added new release action #37

Workflow file for this run

name: Test
on: [push, pull_request]
jobs:
tests:
timeout-minutes: ${{ fromJSON(vars.GHA_DEFAULT_TIMEOUT || 10) }}
name: Busted Tests
runs-on: ubuntu-24.04
permissions:
checks: write
pull-requests: write
steps:
- name: Checkout source code
uses: actions/checkout@main
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Run tests
run: make test-unit DOCKER_RUN_FLAGS_TTY='' BUSTED_COVERAGE=true BUSTED_RUN_PROFILE=ci
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: |
test-results/**/*.xml
- name: Setup LCOV
uses: hrishikesh-kadam/setup-lcov@v1
- name: Report code coverage
uses: zgosalvez/github-actions-report-lcov@v4
with:
coverage-files: test-results/lcov.info
artifact-name: code-coverage-report
github-token: ${{ secrets.GITHUB_TOKEN }}
update-comment: true
smoke-tests:
timeout-minutes: ${{ fromJSON(vars.GHA_DEFAULT_TIMEOUT || 10) }}
name: Smoke Tests
runs-on: ubuntu-24.04
services:
# Define the container service to run for testing
kong-smoke-test-service:
# Reference the local tag you’ll create after building
image: kong.localhost/kong-plugin-kong-authz-openfga-dev-kong-smoke-test:0.1.0
ports:
- 8000:8000
- 8001:8001
# Add any other ports your container exposes
options: >
-e KONG_ANONYMOUS_REPORTS=off
-e KONG_LOG_LEVEL=debug
-e KONG_PLUGINS='bundled,kong-authz-openfga'
-e KONG_DATABASE=off
-e KONG_VITALS=off
-e KONG_NGINX_HTTP_INCLUDE=/kong/smoke-test.nginx.conf
-e KONG_DECLARATIVE_CONFIG=/kong/kong.yaml
-e KONG_ADMIN_LISTEN=0.0.0.0:8001
-e KONG_ADMIN_GUI_URL=http://localhost:8002/
-v '$(PWD)/_build/deployment/kong-smoke-test/kong/smoke-test.nginx.conf:/kong/smoke-test.nginx.conf'
-v '$(PWD)/_build/deployment/kong-smoke-test/kong/kong.local.yaml:/kong/kong.yaml'
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Build “smoke test” container image
run: |
# Build the image using your Makefile target
make container-ci-kong-smoke-test
- name: Wait for service to be ready
run: |
# Give the container a moment to come up
sleep 15
- name: Run smoke tests
run: |
make smoke-test-run-test