Skip to content

Commit 64f2553

Browse files
committed
Fix tests not running on external PRs (#570)
1 parent 2d3c527 commit 64f2553

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

.github/workflows/molecule.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ jobs:
1616
molecule:
1717
name: Molecule
1818
runs-on: ubuntu-22.04
19+
env:
20+
NGINX_CRT: ${{ secrets.NGINX_CRT }}
21+
NGINX_KEY: ${{ secrets.NGINX_KEY }}
1922
strategy:
2023
fail-fast: false
2124
matrix:
@@ -32,24 +35,26 @@ jobs:
3235
- upgrade_plus
3336
steps:
3437
- name: Check out the codebase
38+
if: ${{ !(contains(matrix.scenario, 'plus')) || (env.NGINX_CRT != 0 && env.NGINX_KEY != 0) }}
3539
uses: actions/checkout@v3
3640

3741
- name: Set up Python 3
42+
if: ${{ !(contains(matrix.scenario, 'plus')) || (env.NGINX_CRT != 0 && env.NGINX_KEY != 0) }}
3843
uses: actions/setup-python@v4
3944
with:
4045
python-version: 3.x
4146

4247
- name: Install Molecule dependencies
48+
if: ${{ !(contains(matrix.scenario, 'plus')) || (env.NGINX_CRT != 0 && env.NGINX_KEY != 0) }}
4349
run: pip3 install -r .github/workflows/requirements/requirements_molecule.txt
4450

4551
- name: Install Ansible core dependencies
52+
if: ${{ !(contains(matrix.scenario, 'plus')) || (env.NGINX_CRT != 0 && env.NGINX_KEY != 0) }}
4653
run: ansible-galaxy install -r .github/workflows/requirements/requirements_ansible.yml
4754

4855
- name: Run Molecule tests
49-
if: ${{ env.NGINX_CRT != 0 && env.NGINX_KEY != 0 }}
56+
if: ${{ !(contains(matrix.scenario, 'plus')) || (env.NGINX_CRT != 0 && env.NGINX_KEY != 0) }}
5057
run: molecule test -s ${{ matrix.scenario }}
5158
env:
5259
PY_COLORS: 1
5360
ANSIBLE_FORCE_COLOR: 1
54-
NGINX_CRT: ${{ secrets.NGINX_CRT }}
55-
NGINX_KEY: ${{ secrets.NGINX_KEY }}

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@ FEATURES:
1010
BUG FIXES:
1111

1212
* Fix an issue when installing the GeoIP2 module on an UBI 7 container where the the `libmaxminddb` package dependency might not be available via `yum` (if it's not available, `libmaxminddb` is installed from an external source).
13+
* GitHub actions should now correctly skip \*plus\* scenarios only when the NGINX Plus license secrets are not present.
1314

1415
TESTS:
1516

16-
* Update GitHub actions to run on Ubuntu 22.04. Amazon Linux 2 does not support cgroups v2 so the corresponding Molecule tests have been removed.
17+
Update GitHub actions to run on Ubuntu 22.04. Amazon Linux 2 does not support cgroups v2 so the corresponding Molecule tests have been removed.
1718

1819
## 0.23.2 (September 28, 2022)
1920

0 commit comments

Comments
 (0)