Skip to content

Commit b065e7f

Browse files
authored
Fix tests not running on external PRs (#297)
1 parent a3c8ba2 commit b065e7f

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
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-20.04
19+
env:
20+
NGINX_CRT: ${{ secrets.NGINX_CRT }}
21+
NGINX_KEY: ${{ secrets.NGINX_KEY }}
1922
strategy:
2023
fail-fast: false
2124
matrix:
@@ -26,24 +29,26 @@ jobs:
2629
- stable_push
2730
steps:
2831
- name: Check out the codebase
32+
if: ${{ !(contains(matrix.scenario, 'plus')) || (env.NGINX_CRT != 0 && env.NGINX_KEY != 0) }}
2933
uses: actions/checkout@v3
3034

3135
- name: Set up Python 3
36+
if: ${{ !(contains(matrix.scenario, 'plus')) || (env.NGINX_CRT != 0 && env.NGINX_KEY != 0) }}
3237
uses: actions/setup-python@v4
3338
with:
3439
python-version: 3.x
3540

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

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

4249
- name: Run Molecule tests
43-
if: ${{ env.NGINX_CRT != 0 && env.NGINX_KEY != 0 }}
50+
if: ${{ !(contains(matrix.scenario, 'plus')) || (env.NGINX_CRT != 0 && env.NGINX_KEY != 0) }}
4451
run: molecule test -s ${{ matrix.scenario }}
4552
env:
4653
PY_COLORS: 1
4754
ANSIBLE_FORCE_COLOR: 1
48-
NGINX_CRT: ${{ secrets.NGINX_CRT }}
49-
NGINX_KEY: ${{ secrets.NGINX_KEY }}

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## 0.5.3 (Unreleased)
4+
5+
BUG FIXES:
6+
7+
GitHub actions should now correctly skip \*plus\* scenarios only when the NGINX Plus license secrets are not present.
8+
39
## 0.5.2 (October 17, 2022)
410

511
ENHANCEMENTS:

0 commit comments

Comments
 (0)