Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: don't run ee tests when license unavailable #245

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/integration-test-enterprise.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,18 @@ jobs:
KONG_VERSION: ${{ matrix.kong_version }}
KONG_ANONYMOUS_REPORTS: "off"
KONG_ADMIN_TOKEN: kong
# We don't want to run enterprise tests for contributors whose workflow runs
# do not have access to enterprise license (here, through the means of
# kong-license action) so don't run this job when the required secret is not
# available.
# Instead of making it conditional on job level we need to job.env because
# secrets context is only available at this level.
#
# ref: https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability
#
# PULP_PASSWORD secret is set in "Configure ci" environment
PULP_PASSWORD: ${{ secrets.PULP_PASSWORD }}

runs-on: ubuntu-latest
steps:
# This will set KONG_LINCENSE_DATA environment variable.
Expand All @@ -37,26 +49,33 @@ jobs:
# Warning: Skip output 'license' since it may contain secret.
# on Github Actions when setting a job output.
- uses: Kong/kong-license@9fb64ad7be1ed2b121a70990783d7c0869e531d5
if: env.PULP_PASSWORD != ''
id: license_step
with:
password: ${{ secrets.PULP_PASSWORD }}
- name: Setup go
if: env.PULP_PASSWORD != ''
uses: actions/setup-go@v3
with:
go-version: '^1.16'
- name: Checkout repository
if: env.PULP_PASSWORD != ''
uses: actions/checkout@v3
- uses: actions/cache@v3.0.11
if: env.PULP_PASSWORD != ''
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Setup Kong
if: env.PULP_PASSWORD != ''
run: make setup-kong-ee
- name: Run tests
if: env.PULP_PASSWORD != ''
run: make test-coverage-enterprise
- name: Upload Code Coverage
if: env.PULP_PASSWORD != ''
uses: codecov/codecov-action@v3.1.1
with:
name: codecov-${{ matrix.kong_version }}
Expand Down