diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c935dd4d..81050a44 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -25,9 +25,27 @@ defaults: shell: bash jobs: + changes: + name: Changes + runs-on: ubuntu-22.04 + outputs: + except_docs: ${{ steps.filter.outputs.except_docs }} + steps: + - name: Check for changes + uses: dorny/paths-filter@v3 + id: filter + with: + filters: | + except_docs: + # Match all changes except 'doc/**'. + # If no files outside of 'doc/**' are changed except_docs is set to 'false'. + - '!(doc/**)' + code-tests: name: Code runs-on: ubuntu-22.04 + needs: [changes] + if: ${{ needs.changes.outputs.except_docs == 'true' }} steps: - name: Checkout uses: actions/checkout@v4 @@ -398,7 +416,8 @@ jobs: calc: ALL tmpdir: /tmp/tics - documentation-checks: + doc-tests: + name: Documentation uses: canonical/documentation-workflows/.github/workflows/documentation-checks.yaml@main with: working-directory: './doc' @@ -407,7 +426,7 @@ jobs: snap: name: Trigger snap edge build runs-on: ubuntu-22.04 - needs: [code-tests, system-tests, documentation-checks] + needs: [code-tests, system-tests, doc-tests] if: ${{ github.repository == 'canonical/microcloud' && github.event_name == 'push' && github.actor != 'dependabot[bot]' }} steps: - name: Checkout code