diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index 9cc721b7b..24e29e45d 100644 --- a/.github/workflows/checks.yaml +++ b/.github/workflows/checks.yaml @@ -9,32 +9,58 @@ on: - opened - synchronize - reopened - paths-ignore: - - '**/*.md' - - LICENSE - - CODEOWNERS push: branches: - main - paths-ignore: - - '**/*.md' - - LICENSE - - CODEOWNERS merge_group: branches: - main types: - checks_requested - paths: - - '**' - - '!**/*.md' - - 'docs/**' - - '!LICENSE' - - '!CODEOWNERS' workflow_call: jobs: + deltas: + runs-on: ubuntu-latest + outputs: + paths_changed: ${{ steps.check_paths.outputs.paths_changed }} # Output value to other jobs + steps: + - name: Checkout code + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 + with: + fetch-depth: 0 + + - name: Check if specific paths are changed + id: check_paths + # paths: + # - '**' + # - '!**/*.md' + # - '!LICENSE' + # - '!CODEOWNERS' + run: | + # Check if any non-Markdown files or 'docs/**' changed, and exclude 'LICENSE' and 'CODEOWNERS' + + # Get the commit range for the diff (use HEAD^ for fallback) + before_commit="${{ github.event.before }}" + current_commit="${{ github.sha }}" + + if [ -z "$before_commit" ]; then + before_commit="HEAD^" + fi + + changed_files=$(git diff --name-only $before_commit $current_commit) + echo "Changed files: $changed_files" + + if echo "$changed_files" | grep -Ev '\.md$' | grep -vE '^(LICENSE|CODEOWNERS)$'; then + echo "Paths of interest were modified." + echo "paths_changed=true" >> $GITHUB_OUTPUT + else + echo "No matching paths were modified." + echo "paths_changed=false" >> $GITHUB_OUTPUT + fi go: + needs: deltas + if: ${{ needs.deltas.outputs.paths_changed == 'true' }} runs-on: ubuntu-22.04 permissions: checks: write @@ -102,6 +128,8 @@ jobs: if: env.IS_RELEASE_BRANCH == 'false' integration: + needs: deltas + if: ${{ needs.deltas.outputs.paths_changed == 'true' }} name: integration tests runs-on: ubuntu-22.04 steps: @@ -161,6 +189,8 @@ jobs: run: test/rego/custom-entity.bats image: + needs: deltas + if: ${{ needs.deltas.outputs.paths_changed == 'true' }} name: image build runs-on: ubuntu-22.04 steps: @@ -173,6 +203,8 @@ jobs: push: false platform-xtest: + needs: deltas + if: ${{ needs.deltas.outputs.paths_changed == 'true' }} uses: opentdf/tests/.github/workflows/xtest.yml@main with: # use commit instead of ref so we can "go get" specific sdk version @@ -180,6 +212,8 @@ jobs: # test latest otdfctl CLI 'main' against platform PR branch otdfctl-test: + needs: deltas + if: ${{ needs.deltas.outputs.paths_changed == 'true' }} name: otdfctl e2e tests runs-on: ubuntu-latest steps: @@ -191,6 +225,8 @@ jobs: otdfctl-ref: 'main' buflint: + needs: deltas + if: ${{ needs.deltas.outputs.paths_changed == 'true' }} name: Protocol Buffer Lint and Gencode Up-to-date check runs-on: ubuntu-22.04 steps: @@ -238,6 +274,7 @@ jobs: - license - platform-xtest - otdfctl-test + - deltas runs-on: ubuntu-22.04 if: ${{ !cancelled() }} steps: diff --git a/service/README.md b/service/README.md index 87e97ce1c..4a325251a 100644 --- a/service/README.md +++ b/service/README.md @@ -9,6 +9,8 @@ OpenTDF and ensures that all required services are configured and running as exp ## Quick Start +hello + > [!WARNING] > This quickstart guide is intended for development and testing purposes only. The OpenTDF platform team does not > provide recommendations for production deployments.