diff --git a/.github/workflows/auto-close.yml b/.github/workflows/auto-close.yml index 8b857bb..6beaa11 100644 --- a/.github/workflows/auto-close.yml +++ b/.github/workflows/auto-close.yml @@ -1,31 +1,31 @@ -# SPDX-FileCopyrightText: (C) 2025 Intel Corporation -# SPDX-License-Identifier: Apache-2.0 - ---- - -name: Stale Pull Requests - -# After 30 days of no activity on a PR, the PR should be marked as stale, -# a comment made on the PR informing the author of the new status, -# and closed after 15 days if there is no further activity from the change to stale state. -on: - schedule: - - cron: '30 1 * * *' # run every day - workflow_dispatch: {} -permissions: {} -jobs: - stale-auto-close: - permissions: - contents: read # branch delete will be handled by the repo settings - issues: write - pull-requests: write - runs-on: ubuntu-latest - steps: +# SPDX-FileCopyrightText: (C) 2025 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +--- + +name: Stale Pull Requests + +# After 30 days of no activity on a PR, the PR should be marked as stale, +# a comment made on the PR informing the author of the new status, +# and closed after 15 days if there is no further activity from the change to stale state. +on: + schedule: + - cron: '30 1 * * *' # run every day + workflow_dispatch: {} +permissions: {} +jobs: + stale-auto-close: + permissions: + contents: read # branch delete will be handled by the repo settings + issues: write + pull-requests: write + runs-on: ubuntu-latest + steps: - uses: actions/stale@5f858e3efba33a5ca4407a664cc011ad407f2008 # v10.1.0 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - stale-pr-message: 'This pull request is stale because it has been open 30 days with no activity. Make a comment or update the PR to avoid closing PR after 15 days.' - days-before-pr-stale: 30 - days-before-pr-close: 15 - remove-pr-stale-when-updated: 'true' - close-pr-message: 'This pull request was automatically closed due to inactivity' \ No newline at end of file + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + stale-pr-message: 'This pull request is stale because it has been open 30 days with no activity. Make a comment or update the PR to avoid closing PR after 15 days.' + days-before-pr-stale: 30 + days-before-pr-close: 15 + remove-pr-stale-when-updated: 'true' + close-pr-message: 'This pull request was automatically closed due to inactivity' diff --git a/.github/workflows/auto-update.yml b/.github/workflows/auto-update.yml index a9e52f0..9f60568 100644 --- a/.github/workflows/auto-update.yml +++ b/.github/workflows/auto-update.yml @@ -1,39 +1,39 @@ -# SPDX-FileCopyrightText: (C) 2025 Intel Corporation -# SPDX-License-Identifier: Apache-2.0 - ---- - -name: Auto Update PR - -# On push to the main branch and support branches, update any branches that are out of date -# and have auto-merge enabled. If the branch is currently out of date with the base branch, -# it must be first manually updated and then will be kept up to date on future runs. -on: - push: - branches: - - main - - release-* - -permissions: {} - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - update-pull-requests: - permissions: - contents: read - pull-requests: write - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - - - name: Update pull requests +# SPDX-FileCopyrightText: (C) 2025 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +--- + +name: Auto Update PR + +# On push to the main branch and support branches, update any branches that are out of date +# and have auto-merge enabled. If the branch is currently out of date with the base branch, +# it must be first manually updated and then will be kept up to date on future runs. +on: + push: + branches: + - main + - release-* + +permissions: {} + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + update-pull-requests: + permissions: + contents: read + pull-requests: write + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + with: + persist-credentials: false + + - name: Update pull requests uses: open-edge-platform/orch-ci/.github/actions/pr_updater@e4fa54613527cfaad83ba8b625fd845a4ab8409d # 0.1.53 - with: - github_token: ${{ secrets.SYS_ORCH_GITHUB }} + with: + github_token: ${{ secrets.SYS_ORCH_GITHUB }} diff --git a/.github/workflows/co-integration-test.yaml b/.github/workflows/co-integration-test.yaml index 6b20559..1f37274 100644 --- a/.github/workflows/co-integration-test.yaml +++ b/.github/workflows/co-integration-test.yaml @@ -22,7 +22,7 @@ jobs: VERSION: ${{ github.head_ref }} # Use the component branch that triggered the action for the test steps: - name: Checkout orch ci - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: repository: open-edge-platform/orch-ci path: ci @@ -31,7 +31,7 @@ jobs: persist-credentials: false - name: Checkout cluster-tests for integration tests - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: repository: open-edge-platform/cluster-tests path: cluster-tests diff --git a/.github/workflows/post-merge.yml b/.github/workflows/post-merge.yml index 8110649..b8b02ba 100644 --- a/.github/workflows/post-merge.yml +++ b/.github/workflows/post-merge.yml @@ -10,7 +10,7 @@ on: branches: - main - release-* - workflow_dispatch: + workflow_dispatch: permissions: {} jobs: post-merge: diff --git a/.github/workflows/pre-merge.yml b/.github/workflows/pre-merge.yml index e86c912..6c19fd1 100644 --- a/.github/workflows/pre-merge.yml +++ b/.github/workflows/pre-merge.yml @@ -10,7 +10,7 @@ on: branches: - main - release-* - workflow_dispatch: + workflow_dispatch: permissions: {} @@ -20,101 +20,101 @@ jobs: contents: read runs-on: ubuntu-latest steps: - - name: Checkout PR - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - ref: ${{ github.head_ref }} - persist-credentials: false - - - name: "Setup" - uses: open-edge-platform/orch-ci/.github/actions/bootstrap@e4fa54613527cfaad83ba8b625fd845a4ab8409d # 0.1.53 - with: - gh_token: ${{ secrets.SYS_ORCH_GITHUB }} - bootstrap_tools: "go,gotools,nodejs" - - - name: Configure cache locations - run: | - echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV - echo "GOMODCACHE=$(go env GOMODCACHE)" >> $GITHUB_ENV - - - name: Cache build artifact - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 - with: - path: | - ${{ env.GOCACHE }} - ${{ env.GOMODCACHE }} - ~/.cache/golangci-lint - key: ${{ github.repository }}-lint-${{ runner.os }}-go-${{ hashFiles('**/go.mod') }} - - - name: Lint code - run: make lint + - name: Checkout PR + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + with: + ref: ${{ github.head_ref }} + persist-credentials: false + + - name: "Setup" + uses: open-edge-platform/orch-ci/.github/actions/bootstrap@e4fa54613527cfaad83ba8b625fd845a4ab8409d # 0.1.53 + with: + gh_token: ${{ secrets.SYS_ORCH_GITHUB }} + bootstrap_tools: "go,gotools,nodejs" + + - name: Configure cache locations + run: | + echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV + echo "GOMODCACHE=$(go env GOMODCACHE)" >> $GITHUB_ENV + + - name: Cache build artifact + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + with: + path: | + ${{ env.GOCACHE }} + ${{ env.GOMODCACHE }} + ~/.cache/golangci-lint + key: ${{ github.repository }}-lint-${{ runner.os }}-go-${{ hashFiles('**/go.mod') }} + + - name: Lint code + run: make lint build: permissions: contents: read runs-on: ubuntu-latest steps: - - name: Checkout PR - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - ref: ${{ github.head_ref }} - persist-credentials: false - - - name: "Setup" - uses: open-edge-platform/orch-ci/.github/actions/bootstrap@e4fa54613527cfaad83ba8b625fd845a4ab8409d # 0.1.53 - with: - gh_token: ${{ secrets.SYS_ORCH_GITHUB }} - bootstrap_tools: "go,gotools" - - - name: Configure cache locations - run: | - echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV - echo "GOMODCACHE=$(go env GOMODCACHE)" >> $GITHUB_ENV - - - name: Cache build artifact - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 - with: - path: | - ${{ env.GOCACHE }} - ${{ env.GOMODCACHE }} - key: ${{ github.repository }}-build-${{ runner.os }}-go-${{ hashFiles('**/go.mod') }} - - - name: Build code - run: make build + - name: Checkout PR + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + with: + ref: ${{ github.head_ref }} + persist-credentials: false + + - name: "Setup" + uses: open-edge-platform/orch-ci/.github/actions/bootstrap@e4fa54613527cfaad83ba8b625fd845a4ab8409d # 0.1.53 + with: + gh_token: ${{ secrets.SYS_ORCH_GITHUB }} + bootstrap_tools: "go,gotools" + + - name: Configure cache locations + run: | + echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV + echo "GOMODCACHE=$(go env GOMODCACHE)" >> $GITHUB_ENV + + - name: Cache build artifact + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + with: + path: | + ${{ env.GOCACHE }} + ${{ env.GOMODCACHE }} + key: ${{ github.repository }}-build-${{ runner.os }}-go-${{ hashFiles('**/go.mod') }} + + - name: Build code + run: make build test: permissions: contents: read runs-on: ubuntu-latest steps: - - name: Checkout PR - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - ref: ${{ github.head_ref }} - persist-credentials: false - - - name: "Setup" - uses: open-edge-platform/orch-ci/.github/actions/bootstrap@e4fa54613527cfaad83ba8b625fd845a4ab8409d # 0.1.53 - with: - gh_token: ${{ secrets.SYS_ORCH_GITHUB }} - bootstrap_tools: "go,gotools" - - - name: Configure cache locations - run: | - echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV - echo "GOMODCACHE=$(go env GOMODCACHE)" >> $GITHUB_ENV - - - name: Cache build artifact - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 - with: - path: | - ${{ env.GOCACHE }} - ${{ env.GOMODCACHE }} - key: ${{ github.repository }}-test-${{ runner.os }}-go-${{ hashFiles('**/go.mod') }} - - - name: Test code - run: make test - + - name: Checkout PR + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + with: + ref: ${{ github.head_ref }} + persist-credentials: false + + - name: "Setup" + uses: open-edge-platform/orch-ci/.github/actions/bootstrap@e4fa54613527cfaad83ba8b625fd845a4ab8409d # 0.1.53 + with: + gh_token: ${{ secrets.SYS_ORCH_GITHUB }} + bootstrap_tools: "go,gotools" + + - name: Configure cache locations + run: | + echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV + echo "GOMODCACHE=$(go env GOMODCACHE)" >> $GITHUB_ENV + + - name: Cache build artifact + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + with: + path: | + ${{ env.GOCACHE }} + ${{ env.GOMODCACHE }} + key: ${{ github.repository }}-test-${{ runner.os }}-go-${{ hashFiles('**/go.mod') }} + + - name: Test code + run: make test + pre-merge: permissions: contents: read diff --git a/.github/workflows/service-test.yml b/.github/workflows/service-test.yml index 311f37d..becdc14 100644 --- a/.github/workflows/service-test.yml +++ b/.github/workflows/service-test.yml @@ -12,42 +12,42 @@ on: branches: - main - release-* - workflow_dispatch: - + workflow_dispatch: + jobs: integration-smoke-test: permissions: contents: read runs-on: ubuntu-latest steps: - - name: Checkout orch ci - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - ref: ${{ github.head_ref }} - persist-credentials: false - - - name: Bootstrap CI environment - uses: open-edge-platform/orch-ci/.github/actions/bootstrap@e4fa54613527cfaad83ba8b625fd845a4ab8409d # 0.1.53 - with: - gh_token: ${{ secrets.SYS_ORCH_GITHUB }} - - - name: Run service test - run: make run-service-test - - - name: Gather logs from every pod - if: always() - run: | - mkdir -p service-test-logs - for pod_and_namespace in $(kubectl get pods -A -o jsonpath='{range .items[*]}{.metadata.name}{";"}{.metadata.namespace}{"\n"}{end}'); do - pod=$(echo "$pod_and_namespace" | awk -F';' '{print $1}') - namespace=$(echo "$pod_and_namespace" | awk -F';' '{print $2}') - echo "Gathering logs for pod $pod in namespace $namespace" - kubectl logs "$pod" -n "$namespace" > "./service-test-logs/${pod}.log" || echo "Failed to get logs for $pod in namespace $namespace" - done - - - name: Upload pod logs as evidence - if: always() - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 - with: - name: service-test-logs - path: service-test-logs \ No newline at end of file + - name: Checkout orch ci + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + with: + ref: ${{ github.head_ref }} + persist-credentials: false + + - name: Bootstrap CI environment + uses: open-edge-platform/orch-ci/.github/actions/bootstrap@e4fa54613527cfaad83ba8b625fd845a4ab8409d # 0.1.53 + with: + gh_token: ${{ secrets.SYS_ORCH_GITHUB }} + + - name: Run service test + run: make run-service-test + + - name: Gather logs from every pod + if: always() + run: | + mkdir -p service-test-logs + for pod_and_namespace in $(kubectl get pods -A -o jsonpath='{range .items[*]}{.metadata.name}{";"}{.metadata.namespace}{"\n"}{end}'); do + pod=$(echo "$pod_and_namespace" | awk -F';' '{print $1}') + namespace=$(echo "$pod_and_namespace" | awk -F';' '{print $2}') + echo "Gathering logs for pod $pod in namespace $namespace" + kubectl logs "$pod" -n "$namespace" > "./service-test-logs/${pod}.log" || echo "Failed to get logs for $pod in namespace $namespace" + done + + - name: Upload pod logs as evidence + if: always() + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + with: + name: service-test-logs + path: service-test-logs diff --git a/.github/workflows/validate-openapi.yml b/.github/workflows/validate-openapi.yml index 3ced0c9..4890b03 100644 --- a/.github/workflows/validate-openapi.yml +++ b/.github/workflows/validate-openapi.yml @@ -19,30 +19,30 @@ jobs: runs-on: ubuntu-latest steps: - - name: Checkout repository - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - - - name: Bootstrap CI environment - uses: open-edge-platform/orch-ci/.github/actions/bootstrap@e4fa54613527cfaad83ba8b625fd845a4ab8409d # 0.1.53 - with: - gh_token: ${{ secrets.SYS_ORCH_GITHUB }} - - - name: Generate OpenAPI - run: | - make generate-api - - - name: Check for changes - run: | - if [[ `git status --porcelain` ]]; then - echo "### Error: Changes detected after running make generate-api" - echo "### git status --porcelain" - git status --porcelain - echo "### git diff" - git diff - echo "### Error: Changes detected after running make generate-api" >> $GITHUB_STEP_SUMMARY - exit 1 - else - echo "No changes detected - OpenAPI is up to date" >> $GITHUB_STEP_SUMMARY - fi + - name: Checkout repository + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + with: + persist-credentials: false + + - name: Bootstrap CI environment + uses: open-edge-platform/orch-ci/.github/actions/bootstrap@e4fa54613527cfaad83ba8b625fd845a4ab8409d # 0.1.53 + with: + gh_token: ${{ secrets.SYS_ORCH_GITHUB }} + + - name: Generate OpenAPI + run: | + make generate-api + + - name: Check for changes + run: | + if [[ `git status --porcelain` ]]; then + echo "### Error: Changes detected after running make generate-api" + echo "### git status --porcelain" + git status --porcelain + echo "### git diff" + git diff + echo "### Error: Changes detected after running make generate-api" >> $GITHUB_STEP_SUMMARY + exit 1 + else + echo "No changes detected - OpenAPI is up to date" >> $GITHUB_STEP_SUMMARY + fi