Skip to content

Commit

Permalink
fix: github conditionals must test str not bool
Browse files Browse the repository at this point in the history
  • Loading branch information
clay-lake committed Dec 2, 2024
1 parent 7fd4be7 commit fe1870e
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 14 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/Test-Rock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ jobs:
runs-on: ubuntu-22.04
name: "test-oci-compliance ${{ inputs.oci-archive-name != '' && format('| {0}', inputs.oci-archive-name) || ' '}}"
needs: [configure-tests]
if: ${{ inputs.test-oci-compliance }}
if: ${{ inputs.test-oci-compliance == 'true' }}
steps:
- uses: actions/cache/restore@v4
with:
Expand Down Expand Up @@ -139,7 +139,7 @@ jobs:
runs-on: ${{ matrix.os }}
name: "test-black-box ${{ inputs.oci-archive-name != '' && format('| {0}', inputs.oci-archive-name) || ' '}}"
needs: [configure-tests]
if: ${{ inputs.test-black-box }}
if: ${{ inputs.test-black-box == 'true' }}
steps:
- uses: actions/cache/restore@v4
with:
Expand Down Expand Up @@ -170,7 +170,7 @@ jobs:
needs: [configure-tests]
# TODO: remove once https://chat.charmhub.io/charmhub/pl/o5wxpb65ffbfzy7bcmi8kzftzy is fixed
continue-on-error: true
if: ${{ inputs.test-efficiency }}
if: ${{ inputs.test-efficiency == 'true' }}
steps:

- name: Cloning OCI Factory
Expand Down Expand Up @@ -208,7 +208,7 @@ jobs:
runs-on: ubuntu-22.04
name: "test-vulnerabilities ${{ inputs.oci-archive-name != '' && format('| {0}', inputs.oci-archive-name) || ' '}}"
needs: [configure-tests]
if: ${{ inputs.test-vulnerabilities }}
if: ${{ inputs.test-vulnerabilities == 'true' }}
steps:

- name: Cloning OCI Factory
Expand Down Expand Up @@ -275,7 +275,7 @@ jobs:
runs-on: ubuntu-22.04
name: "test-malware ${{ inputs.oci-archive-name != '' && format('| {0}', inputs.oci-archive-name) || ' '}}"
needs: [configure-tests]
if: ${{ inputs.test-malware }}
if: ${{ inputs.test-malware == 'true' }}
steps:
- name: Cloning OCI Factory
uses: actions/checkout@v4
Expand Down
30 changes: 21 additions & 9 deletions .github/workflows/_Test-OCI-Factory.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,26 @@ jobs:
run: |
find ${{ github.workspace }} -name 'test-*.bats' | xargs bats
# # Test use case of reuseable workflow
# build-rock:
# uses: ./.github/workflows/Build-Rock.yaml
# with:
# # mock rock
# oci-archive-name: "mock-rock"
# rock-repo: canonical/rocks-toolbox
# rock-repo-commit: main
# rockfile-directory: mock_rock/1.2 # 1.0 - multi arch, 1.2 single arch rock
# Test use case of reuseable workflow
build-rock:
uses: ./.github/workflows/Build-Rock.yaml
with:
# mock rock
oci-archive-name: "mock-rock"
rock-repo: canonical/rocks-toolbox
rock-repo-commit: main
rockfile-directory: mock_rock/1.2 # 1.0 - multi arch, 1.2 single arch rock

test-rock:
uses: ./.github/workflows/Test-Rock.yaml
needs: [build-rock]
with:
oci-archive-name: "mock-rock"
test-black-box: true
test-efficiency: false
test-malware: false
test-oci-compliance: false
test-vulnerabilities: false

# test-rock:
# uses: ./.github/workflows/Test-Rock.yaml
Expand All @@ -117,6 +128,7 @@ jobs:
# test-oci-compliance: true
# test-vulnerabilities: true


# # Test workflow used in continuous testing
# test-vulnerability-scan:
# name: Test vulnerability scan workflow
Expand Down

0 comments on commit fe1870e

Please sign in to comment.