diff options
Diffstat (limited to '.github/workflows')
| -rw-r--r-- | .github/workflows/add-rebase-label.yml | 14 | ||||
| -rw-r--r-- | .github/workflows/auto-author-assign.yml | 14 | ||||
| -rw-r--r-- | .github/workflows/check-pr-conflicts.yml | 24 | ||||
| -rw-r--r-- | .github/workflows/check-typos.yml (renamed from .github/workflows/check-pr-message.yml) | 8 | ||||
| -rw-r--r-- | .github/workflows/check-unused-imports.yml | 14 | ||||
| -rw-r--r-- | .github/workflows/cla-check.yml | 18 | ||||
| -rw-r--r-- | .github/workflows/cleanup-mirror-pr-branch.yml | 16 | ||||
| -rw-r--r-- | .github/workflows/codeql.yml | 10 | ||||
| -rw-r--r-- | .github/workflows/darker-ruff-lint.yml (renamed from .github/workflows/add-pr-labels.yml) | 8 | ||||
| -rw-r--r-- | .github/workflows/label-backport.yml | 12 | ||||
| -rw-r--r-- | .github/workflows/lint-with-ruff.yml | 14 | ||||
| -rw-r--r-- | .github/workflows/mirror-pr-and-sync.yml | 21 | ||||
| -rw-r--r-- | .github/workflows/package-smoketest.yml | 331 | ||||
| -rw-r--r-- | .github/workflows/pr-mirror-repo-sync.yml | 30 | ||||
| -rw-r--r-- | .github/workflows/sonarcloud.yml | 28 | ||||
| -rw-r--r-- | .github/workflows/trigger-pr-mirror-repo-sync.yml | 13 | ||||
| -rw-r--r-- | .github/workflows/trigger-rebuild-repo-package.yml | 4 |
17 files changed, 351 insertions, 228 deletions
diff --git a/.github/workflows/add-rebase-label.yml b/.github/workflows/add-rebase-label.yml deleted file mode 100644 index 9041303af..000000000 --- a/.github/workflows/add-rebase-label.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: Add rebase label - -on: - pull_request_target: - types: [synchronize, opened, reopened, labeled, unlabeled] - -permissions: - pull-requests: write - contents: read - -jobs: - add-rebase-label: - uses: vyos/.github/.github/workflows/add-rebase-label.yml@current - secrets: inherit diff --git a/.github/workflows/auto-author-assign.yml b/.github/workflows/auto-author-assign.yml deleted file mode 100644 index 61612cce3..000000000 --- a/.github/workflows/auto-author-assign.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: "PR Triage" -on: - pull_request_target: - types: [opened, reopened, ready_for_review, locked] - - -permissions: - pull-requests: write - contents: read - -jobs: - assign-author: - uses: vyos/.github/.github/workflows/assign-author.yml@current - secrets: inherit diff --git a/.github/workflows/check-pr-conflicts.yml b/.github/workflows/check-pr-conflicts.yml index f09e66415..91e786c3c 100644 --- a/.github/workflows/check-pr-conflicts.yml +++ b/.github/workflows/check-pr-conflicts.yml @@ -1,14 +1,24 @@ -name: "PR Conflicts checker" +name: "PRs Conflict checker" on: + schedule: + # Run every hour to check for PR conflicts + - cron: '0 * * * *' pull_request_target: - types: [synchronize] - -permissions: - pull-requests: write - contents: read + types: [synchronize, closed] + workflow_dispatch: # Allow manual triggering jobs: - check-pr-conflict-call: + check-prs-conflict: + if: | + github.event_name == 'schedule' || + github.event_name == 'workflow_dispatch' || + (github.event_name == 'pull_request_target' && github.event.action == 'synchronize') || + (github.event_name == 'pull_request_target' && github.event.action == 'closed' && github.event.pull_request.merged == true) uses: vyos/.github/.github/workflows/check-pr-merge-conflict.yml@current + permissions: + contents: read + pull-requests: write secrets: inherit + with: + action-ref: 'current' diff --git a/.github/workflows/check-pr-message.yml b/.github/workflows/check-typos.yml index 625ba2d75..04dd4837b 100644 --- a/.github/workflows/check-pr-message.yml +++ b/.github/workflows/check-typos.yml @@ -1,10 +1,12 @@ --- -name: Check pull request message format +name: Check typos on: pull_request_target: branches: - current + - circinus + - sagitta types: [opened, synchronize, edited] permissions: @@ -12,6 +14,6 @@ permissions: contents: read jobs: - check-pr-title: - uses: vyos/.github/.github/workflows/check-pr-message.yml@current + check-typos: + uses: vyos/.github/.github/workflows/check-typos.yml@current secrets: inherit diff --git a/.github/workflows/check-unused-imports.yml b/.github/workflows/check-unused-imports.yml deleted file mode 100644 index d6dd61483..000000000 --- a/.github/workflows/check-unused-imports.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: Check for unused imports using Pylint -on: - pull_request_target: - branches: - - current - -permissions: - pull-requests: write - contents: read - -jobs: - check-unused-imports: - uses: vyos/.github/.github/workflows/check-unused-imports.yml@current - secrets: inherit diff --git a/.github/workflows/cla-check.yml b/.github/workflows/cla-check.yml new file mode 100644 index 000000000..4b8182585 --- /dev/null +++ b/.github/workflows/cla-check.yml @@ -0,0 +1,18 @@ +name: "CLA Check" + +permissions: + actions: write + contents: read + pull-requests: write + statuses: write + +on: + pull_request_target: + types: [opened, synchronize, closed] + issue_comment: + types: [created] + +jobs: + call-cla-assistant: + uses: vyos/vyos-cla-signatures/.github/workflows/cla-reusable.yml@current + secrets: inherit diff --git a/.github/workflows/cleanup-mirror-pr-branch.yml b/.github/workflows/cleanup-mirror-pr-branch.yml deleted file mode 100644 index a62e44b24..000000000 --- a/.github/workflows/cleanup-mirror-pr-branch.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Cleanup pr mirror branch - -on: - pull_request: - types: [closed] - branches: - - current - -permissions: - contents: write - -jobs: - call-delete-branch: - if: github.repository_owner != 'vyos' - uses: vyos/.github/.github/workflows/cleanup-mirror-pr-branch.yml@current - secrets: inherit diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 143029c14..bc9f06f6d 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -2,14 +2,20 @@ name: "Perform CodeQL Analysis" on: push: - branches: [ "current" ] + branches: + - current + - circinus + - sagitta paths: - '**' - '!.github/**' - '!**/*.md' pull_request: # The branches below must be a subset of the branches above - branches: [ "current" ] + branches: + - current + - circinus + - sagitta paths: - '**' - '!.github/**' diff --git a/.github/workflows/add-pr-labels.yml b/.github/workflows/darker-ruff-lint.yml index a0c076064..0307d14d4 100644 --- a/.github/workflows/add-pr-labels.yml +++ b/.github/workflows/darker-ruff-lint.yml @@ -1,6 +1,4 @@ ---- -name: Add pull request labels - +name: Python Lint (Darker + Ruff) on: pull_request_target: branches: @@ -11,6 +9,6 @@ permissions: contents: read jobs: - add-pr-label: - uses: vyos/.github/.github/workflows/add-pr-labels.yml@current + darker-ruff-lint: + uses: vyos/.github/.github/workflows/lint-with-darker-ruff.yml@current secrets: inherit diff --git a/.github/workflows/label-backport.yml b/.github/workflows/label-backport.yml deleted file mode 100644 index efbd4388f..000000000 --- a/.github/workflows/label-backport.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: Mergifyio backport - -on: [issue_comment] - -permissions: - pull-requests: write - contents: read - -jobs: - mergifyio-backport: - uses: vyos/.github/.github/workflows/label-backport.yml@current - secrets: inherit diff --git a/.github/workflows/lint-with-ruff.yml b/.github/workflows/lint-with-ruff.yml deleted file mode 100644 index 00cc9ca1b..000000000 --- a/.github/workflows/lint-with-ruff.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: Lint py code with ruff -on: - pull_request_target: - branches: - - current - -permissions: - pull-requests: write - contents: read - -jobs: - ruff-lint: - uses: vyos/.github/.github/workflows/lint-with-ruff.yml@current - secrets: inherit diff --git a/.github/workflows/mirror-pr-and-sync.yml b/.github/workflows/mirror-pr-and-sync.yml deleted file mode 100644 index 120e116d4..000000000 --- a/.github/workflows/mirror-pr-and-sync.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Create Mirror PR and Repo Sync -on: - workflow_dispatch: - inputs: - sync_branch: - description: 'branch to sync' - required: true - type: string - -permissions: - pull-requests: write - contents: write - -jobs: - call-mirror-pr-and-sync: - if: github.repository_owner != 'vyos' - uses: VyOS-Networks/vyos-reusable-workflows/.github/workflows/mirror-pr-and-sync.yml@main - with: - sync_branch: ${{ inputs.sync_branch }} - secrets: - PAT: ${{ secrets.PAT }} diff --git a/.github/workflows/package-smoketest.yml b/.github/workflows/package-smoketest.yml index 2c90fed39..20430e189 100644 --- a/.github/workflows/package-smoketest.yml +++ b/.github/workflows/package-smoketest.yml @@ -1,9 +1,21 @@ -name: VyOS ISO integration Test +name: VyOS ISO Integration Test on: + workflow_dispatch: + push: + branches: + - current + - circinus + - sagitta + paths: + - '**' + - '!.github/**' + - '!**/*.md' pull_request_target: branches: - current + - circinus + - sagitta paths: - '**' - '!.github/**' @@ -14,41 +26,144 @@ permissions: contents: read env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed for PR comments + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} BUILD_BY: autobuild@vyos.net DEBIAN_MIRROR: http://deb.debian.org/debian/ DEBIAN_SECURITY_MIRROR: http://deb.debian.org/debian-security - VYOS_MIRROR: https://packages.vyos.net/repositories/current/ jobs: + set_config: + runs-on: ubuntu-latest + outputs: + branch: ${{ steps.config.outputs.branch }} + vyos_mirror: ${{ steps.config.outputs.vyos_mirror }} + container_image: ${{ steps.config.outputs.container_image }} + vyos_build_repo: ${{ steps.config.outputs.vyos_build_repo }} + build_version_format: ${{ steps.config.outputs.build_version_format }} + build_runner: ${{ steps.config.outputs.build_runner }} + use_pat: ${{ steps.config.outputs.use_pat }} + test_cli_command: ${{ steps.config.outputs.test_cli_command }} + test_tpm_tests: ${{ steps.config.outputs.test_tpm_tests }} + test_vpp: ${{ steps.config.outputs.test_vpp }} + test_vpp_runner: ${{ steps.config.outputs.test_vpp_runner }} + install_build_deps: ${{ steps.config.outputs.install_build_deps }} + mirror_enabled: ${{ steps.config.outputs.mirror_enabled }} + vyos_build_ref: ${{ steps.determine-ref.outputs.vyos_build_ref }} + steps: + - name: Checkout repository + uses: actions/checkout@v6 + + - name: Set branch-specific configuration + id: config + run: | + if [[ "${{ github.event_name }}" == "pull_request_target" ]]; then + BRANCH="${{ github.event.pull_request.base.ref }}" + else + BRANCH="${{ github.ref_name }}" + fi + + CONFIG=$(jq ".branches[\"${BRANCH}\"]" .github/config/smoketest-branches.json) + + if [ "$CONFIG" = "null" ] || [ -z "$CONFIG" ]; then + echo "::error::No smoketest configuration found for branch '${BRANCH}' in .github/config/smoketest-branches.json" + exit 1 + fi + + echo "branch=${BRANCH}" >> $GITHUB_OUTPUT + echo "vyos_mirror=$(echo $CONFIG | jq -r .vyos_mirror)" >> $GITHUB_OUTPUT + echo "container_image=$(echo $CONFIG | jq -r .container_image)" >> $GITHUB_OUTPUT + echo "vyos_build_repo=$(echo $CONFIG | jq -r .vyos_build_repo)" >> $GITHUB_OUTPUT + echo "build_version_format=$(echo $CONFIG | jq -r .build_version_format)" >> $GITHUB_OUTPUT + echo "build_runner=$(echo $CONFIG | jq -c .build_runner)" >> $GITHUB_OUTPUT + echo "use_pat=$(echo $CONFIG | jq -r .use_pat)" >> $GITHUB_OUTPUT + echo "test_cli_command=$(echo $CONFIG | jq -r .test_cli_command)" >> $GITHUB_OUTPUT + echo "test_tpm_tests=$(echo $CONFIG | jq -r .test_tpm_tests)" >> $GITHUB_OUTPUT + echo "test_vpp=$(echo $CONFIG | jq -r .test_vpp)" >> $GITHUB_OUTPUT + echo "test_vpp_runner=$(echo $CONFIG | jq -c .test_vpp_runner)" >> $GITHUB_OUTPUT + echo "install_build_deps=$(echo $CONFIG | jq -r .install_build_deps)" >> $GITHUB_OUTPUT + echo "mirror_enabled=$(echo $CONFIG | jq -r .mirror_enabled)" >> $GITHUB_OUTPUT + + - name: Determine vyos-build ref + id: determine-ref + env: + GH_TOKEN: ${{ steps.config.outputs.use_pat == 'true' && secrets.PAT || secrets.GITHUB_TOKEN }} + run: | + BRANCH="${{ steps.config.outputs.branch }}" + VYOS_BUILD_REPO="${{ steps.config.outputs.vyos_build_repo }}" + + if [[ "${{ github.event_name }}" == "pull_request_target" ]]; then + PR_HEAD_REF="${{ github.event.pull_request.head.ref }}" + + # VYOS_BUILD_REPO is in owner/repo format from config + REPO_PATH="$VYOS_BUILD_REPO" + + # Get creation date from 90 days ago + CREATED_AFTER=$(date -u -d "90 days ago" +"%Y-%m-%dT%H:%M:%SZ") + + echo "Looking for PR in $REPO_PATH with branch '$PR_HEAD_REF' created after $CREATED_AFTER" + + # Query GitHub API for matching PR with merge commit SHA + MATCHING_PR_MERGE_SHA=$(gh api repos/$REPO_PATH/pulls \ + --jq ".[] | select(.created_at > \"$CREATED_AFTER\" and .head.ref == \"$PR_HEAD_REF\") | .merge_commit_sha" 2>&1 | grep -v '^{' | head -1) + + echo "Merge commit SHA: $MATCHING_PR_MERGE_SHA" + + # Check if response is a valid SHA (40-char hex) or an error + if [[ $MATCHING_PR_MERGE_SHA =~ ^[a-f0-9]{40}$ ]]; then + # Use the merge commit SHA - this is what the code would look like if merged + echo "vyos_build_ref=$MATCHING_PR_MERGE_SHA" >> $GITHUB_OUTPUT + echo "Found matching open PR in vyos-build with branch '$PR_HEAD_REF', using merge commit: $MATCHING_PR_MERGE_SHA" + else + echo "vyos_build_ref=$BRANCH" >> $GITHUB_OUTPUT + echo "No matching open PR found in vyos-build for branch '$PR_HEAD_REF', falling back to '$BRANCH'" + fi + else + echo "vyos_build_ref=$BRANCH" >> $GITHUB_OUTPUT + echo "Using configured branch '$BRANCH'" + fi + build_iso: - runs-on: ubuntu-24.04 + needs: set_config + runs-on: ${{ fromJson(needs.set_config.outputs.build_runner) }} timeout-minutes: 45 - if: github.repository == 'vyos/vyos-1x' + if: ${{ needs.set_config.outputs.mirror_enabled == 'false' || (needs.set_config.outputs.mirror_enabled == 'true' && github.repository_owner == 'vyos') }} container: - image: vyos/vyos-build:current + image: ${{ needs.set_config.outputs.container_image }} options: --sysctl net.ipv6.conf.lo.disable_ipv6=0 --privileged outputs: build_version: ${{ steps.version.outputs.build_version }} steps: - name: Clone vyos-build source code - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: - repository: vyos/vyos-build + repository: ${{ needs.set_config.outputs.vyos_build_repo }} + token: ${{ needs.set_config.outputs.use_pat == 'true' && secrets.PAT || secrets.GITHUB_TOKEN }} + ref: ${{ needs.set_config.outputs.vyos_build_ref }} + - name: Clone vyos-1x source code - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: path: packages/vyos-1x fetch-depth: 0 - ref: ${{ github.event.pull_request.head.sha }} - repository: ${{ github.event.pull_request.head.repo.full_name }} + ref: ${{ github.event.pull_request.head.sha || github.sha }} + repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }} + token: ${{ needs.set_config.outputs.use_pat == 'true' && secrets.PAT || secrets.GITHUB_TOKEN }} + submodules: true + - name: Build vyos-1x package run: | - cd packages/vyos-1x; dpkg-buildpackage -uc -us -tc -b + cd packages/vyos-1x + if [[ "${{ needs.set_config.outputs.install_build_deps }}" == "true" ]]; then + sudo apt-get update + sudo apt-get build-dep -y . + fi + dpkg-buildpackage -uc -us -tc -b + - name: Generate ISO version string id: version run: | - echo "build_version=1.5-integration-$(date -u +%Y%m%d%H%M)" >> $GITHUB_OUTPUT + echo "build_version=$(date -u +'${{ needs.set_config.outputs.build_version_format }}')" >> $GITHUB_OUTPUT + - name: Build custom ISO image shell: bash run: | @@ -60,9 +175,10 @@ jobs: --debian-mirror $DEBIAN_MIRROR \ --debian-security-mirror $DEBIAN_SECURITY_MIRROR \ --version ${{ steps.version.outputs.build_version }} \ - --vyos-mirror $VYOS_MIRROR \ + --vyos-mirror ${{ needs.set_config.outputs.vyos_mirror }} \ generic - - uses: actions/upload-artifact@v4 + + - uses: actions/upload-artifact@v7 with: retention-days: 2 name: vyos-${{ steps.version.outputs.build_version }} @@ -70,166 +186,251 @@ jobs: build/live-image-amd64.hybrid.iso build/manifest.json + - uses: atos-actions/clean-self-hosted-runner@v1.4.10 + if: ${{ always() && contains(needs.set_config.outputs.build_runner, 'self-hosted') }} + test_smoketest_cli: - needs: build_iso + needs: [build_iso, set_config] runs-on: ubuntu-24.04 timeout-minutes: 180 container: - image: vyos/vyos-build:current + image: ${{ needs.set_config.outputs.container_image }} options: --sysctl net.ipv6.conf.lo.disable_ipv6=0 --privileged outputs: exit_code: ${{ steps.test.outputs.exit_code }} steps: - # We need the test script from vyos-build repo - name: Clone vyos-build source code - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: - repository: vyos/vyos-build - - uses: actions/download-artifact@v4 + repository: ${{ needs.set_config.outputs.vyos_build_repo }} + token: ${{ needs.set_config.outputs.use_pat == 'true' && secrets.PAT || secrets.GITHUB_TOKEN }} + ref: ${{ needs.set_config.outputs.vyos_build_ref }} + + - uses: actions/download-artifact@v8 with: name: vyos-${{ needs.build_iso.outputs.build_version }} path: build + - name: VyOS CLI smoketests (no interfaces) id: test shell: bash run: | - set -e - sudo make test-no-interfaces - if [[ $? == 0 ]]; then + if sudo make ${{ needs.set_config.outputs.test_cli_command }}; then + echo "exit_code=success" >> $GITHUB_OUTPUT + else + echo "exit_code=fail" >> $GITHUB_OUTPUT + exit 1 + fi + + test_smoketest_cli_vpp: + needs: [build_iso, set_config] + if: needs.set_config.outputs.test_vpp == 'true' + runs-on: ${{ fromJson(needs.set_config.outputs.test_vpp_runner) }} + timeout-minutes: 90 + container: + image: ${{ needs.set_config.outputs.container_image }} + options: --sysctl net.ipv6.conf.lo.disable_ipv6=0 --privileged + outputs: + exit_code: ${{ steps.test.outputs.exit_code }} + steps: + - name: Clone vyos-build source code + uses: actions/checkout@v6 + with: + repository: ${{ needs.set_config.outputs.vyos_build_repo }} + token: ${{ needs.set_config.outputs.use_pat == 'true' && secrets.PAT || secrets.GITHUB_TOKEN }} + ref: ${{ needs.set_config.outputs.vyos_build_ref }} + + - uses: actions/download-artifact@v8 + with: + name: vyos-${{ needs.build_iso.outputs.build_version }} + path: build + + - name: VyOS CLI smoketests VPP + id: test + shell: bash + run: | + if sudo make test-vpp; then echo "exit_code=success" >> $GITHUB_OUTPUT else echo "exit_code=fail" >> $GITHUB_OUTPUT + exit 1 fi test_interfaces_cli: - needs: build_iso + needs: [build_iso, set_config] runs-on: ubuntu-24.04 timeout-minutes: 180 container: - image: vyos/vyos-build:current + image: ${{ needs.set_config.outputs.container_image }} options: --sysctl net.ipv6.conf.lo.disable_ipv6=0 --privileged outputs: exit_code: ${{ steps.test.outputs.exit_code }} steps: - # We need the test script from vyos-build repo - name: Clone vyos-build source code - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: - repository: vyos/vyos-build - - uses: actions/download-artifact@v4 + repository: ${{ needs.set_config.outputs.vyos_build_repo }} + token: ${{ needs.set_config.outputs.use_pat == 'true' && secrets.PAT || secrets.GITHUB_TOKEN }} + ref: ${{ needs.set_config.outputs.vyos_build_ref }} + + - uses: actions/download-artifact@v8 with: name: vyos-${{ needs.build_iso.outputs.build_version }} path: build + - name: VyOS CLI smoketests (interfaces only) id: test shell: bash run: | - set -e - sudo make test-interfaces - if [[ $? == 0 ]]; then + if sudo make test-interfaces; then echo "exit_code=success" >> $GITHUB_OUTPUT else echo "exit_code=fail" >> $GITHUB_OUTPUT + exit 1 fi test_config_load: - needs: build_iso + needs: [build_iso, set_config] runs-on: ubuntu-24.04 timeout-minutes: 90 container: - image: vyos/vyos-build:current + image: ${{ needs.set_config.outputs.container_image }} options: --sysctl net.ipv6.conf.lo.disable_ipv6=0 --privileged outputs: exit_code: ${{ steps.test.outputs.exit_code }} steps: - # We need the test script from vyos-build repo - name: Clone vyos-build source code - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: - repository: vyos/vyos-build - - uses: actions/download-artifact@v4 + repository: ${{ needs.set_config.outputs.vyos_build_repo }} + token: ${{ needs.set_config.outputs.use_pat == 'true' && secrets.PAT || secrets.GITHUB_TOKEN }} + ref: ${{ needs.set_config.outputs.vyos_build_ref }} + + - uses: actions/download-artifact@v8 with: name: vyos-${{ needs.build_iso.outputs.build_version }} path: build + - name: VyOS config load tests id: test shell: bash run: | - set -e - sudo make testc - if [[ $? == 0 ]]; then + if sudo make testc; then + echo "exit_code=success" >> $GITHUB_OUTPUT + else + echo "exit_code=fail" >> $GITHUB_OUTPUT + exit 1 + fi + + test_config_load_vpp: + needs: [build_iso, set_config] + if: needs.set_config.outputs.test_vpp == 'true' + runs-on: ${{ fromJson(needs.set_config.outputs.test_vpp_runner) }} + timeout-minutes: 90 + container: + image: ${{ needs.set_config.outputs.container_image }} + options: --sysctl net.ipv6.conf.lo.disable_ipv6=0 --privileged + outputs: + exit_code: ${{ steps.test.outputs.exit_code }} + steps: + - name: Clone vyos-build source code + uses: actions/checkout@v6 + with: + repository: ${{ needs.set_config.outputs.vyos_build_repo }} + token: ${{ needs.set_config.outputs.use_pat == 'true' && secrets.PAT || secrets.GITHUB_TOKEN }} + ref: ${{ needs.set_config.outputs.vyos_build_ref }} + + - uses: actions/download-artifact@v8 + with: + name: vyos-${{ needs.build_iso.outputs.build_version }} + path: build + + - name: VyOS config load tests VPP + id: test + shell: bash + run: | + if sudo make testcvpp; then echo "exit_code=success" >> $GITHUB_OUTPUT else echo "exit_code=fail" >> $GITHUB_OUTPUT + exit 1 fi test_raid1_install: - needs: build_iso + needs: [build_iso, set_config] runs-on: ubuntu-24.04 timeout-minutes: 20 container: - image: vyos/vyos-build:current + image: ${{ needs.set_config.outputs.container_image }} options: --sysctl net.ipv6.conf.lo.disable_ipv6=0 --privileged outputs: exit_code: ${{ steps.test.outputs.exit_code }} steps: - # We need the test script from vyos-build repo - name: Clone vyos-build source code - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: - repository: vyos/vyos-build - - uses: actions/download-artifact@v4 + repository: ${{ needs.set_config.outputs.vyos_build_repo }} + token: ${{ needs.set_config.outputs.use_pat == 'true' && secrets.PAT || secrets.GITHUB_TOKEN }} + ref: ${{ needs.set_config.outputs.vyos_build_ref }} + + - uses: actions/download-artifact@v8 with: name: vyos-${{ needs.build_iso.outputs.build_version }} path: build + - name: VyOS RAID1 installation tests id: test shell: bash run: | - set -e - sudo make testraid - if [[ $? == 0 ]]; then + if sudo make testraid; then echo "exit_code=success" >> $GITHUB_OUTPUT else echo "exit_code=fail" >> $GITHUB_OUTPUT + exit 1 fi test_encrypted_config_tpm: - needs: build_iso + needs: [build_iso, set_config] + if: needs.set_config.outputs.test_tpm_tests == 'true' runs-on: ubuntu-24.04 timeout-minutes: 30 container: - image: vyos/vyos-build:current + image: ${{ needs.set_config.outputs.container_image }} options: --sysctl net.ipv6.conf.lo.disable_ipv6=0 --privileged outputs: exit_code: ${{ steps.test.outputs.exit_code }} steps: - # We need the test script from vyos-build repo - name: Clone vyos-build source code - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: - repository: vyos/vyos-build - - uses: actions/download-artifact@v4 + repository: ${{ needs.set_config.outputs.vyos_build_repo }} + token: ${{ needs.set_config.outputs.use_pat == 'true' && secrets.PAT || secrets.GITHUB_TOKEN }} + ref: ${{ needs.set_config.outputs.vyos_build_ref }} + + - uses: actions/download-artifact@v8 with: name: vyos-${{ needs.build_iso.outputs.build_version }} path: build + - name: VyOS TPM encryption tests id: test shell: bash run: | - set -e - sudo make testtpm - if [[ $? == 0 ]]; then + if sudo make testtpm; then echo "exit_code=success" >> $GITHUB_OUTPUT else echo "exit_code=fail" >> $GITHUB_OUTPUT + exit 1 fi result: needs: + - set_config - test_smoketest_cli + - test_smoketest_cli_vpp - test_interfaces_cli - test_config_load + - test_config_load_vpp - test_raid1_install - test_encrypted_config_tpm runs-on: ubuntu-24.04 @@ -237,21 +438,23 @@ jobs: if: always() steps: - name: Add PR comment - if: always() + if: always() && github.event_name == 'pull_request_target' uses: mshick/add-pr-comment@v2 with: message: | - CI integration ${{ needs.test_smoketest_cli.outputs.exit_code == 'success' && needs.test_interfaces_cli.outputs.exit_code == 'success' && needs.test_config_load.outputs.exit_code == 'success' && needs.test_raid1_install.outputs.exit_code == 'success' && '👍 passed!' || '❌ failed!' }} + CI integration ${{ (needs.test_smoketest_cli.outputs.exit_code == 'success' && needs.test_interfaces_cli.outputs.exit_code == 'success' && needs.test_config_load.outputs.exit_code == 'success' && needs.test_raid1_install.outputs.exit_code == 'success' && (needs.test_smoketest_cli_vpp.outputs.exit_code != 'fail') && (needs.test_config_load_vpp.outputs.exit_code != 'fail') && (needs.test_encrypted_config_tpm.outputs.exit_code != 'fail')) && '👍 passed!' || '❌ failed!' }} ### Details [CI logs](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) - * CLI Smoketests (no interfaces) ${{ needs.test_smoketest_cli.outputs.exit_code == 'success' && '👍 passed' || '❌ failed' }} + * CLI Smoketests ${{ needs.test_smoketest_cli.outputs.exit_code == 'success' && '👍 passed' || '❌ failed' }} * CLI Smoketests (interfaces only) ${{ needs.test_interfaces_cli.outputs.exit_code == 'success' && '👍 passed' || '❌ failed' }} * Config tests ${{ needs.test_config_load.outputs.exit_code == 'success' && '👍 passed' || '❌ failed' }} * RAID1 tests ${{ needs.test_raid1_install.outputs.exit_code == 'success' && '👍 passed' || '❌ failed' }} - * TPM tests ${{ needs.test_encrypted_config_tpm.outputs.exit_code == 'success' && '👍 passed' || '❌ failed' }} + * CLI Smoketests VPP ${{ needs.test_smoketest_cli_vpp.outputs.exit_code == 'success' && '👍 passed' || needs.test_smoketest_cli_vpp.outputs.exit_code == 'fail' && '❌ failed' || '⏭️ skipped' }} + * Config tests VPP ${{ needs.test_config_load_vpp.outputs.exit_code == 'success' && '👍 passed' || needs.test_config_load_vpp.outputs.exit_code == 'fail' && '❌ failed' || '⏭️ skipped' }} + * TPM tests ${{ needs.test_encrypted_config_tpm.outputs.exit_code == 'success' && '👍 passed' || needs.test_encrypted_config_tpm.outputs.exit_code == 'fail' && '❌ failed' || '⏭️ skipped' }} message-id: "SMOKETEST_RESULTS" allow-repeats: false diff --git a/.github/workflows/pr-mirror-repo-sync.yml b/.github/workflows/pr-mirror-repo-sync.yml new file mode 100644 index 000000000..0f6c44963 --- /dev/null +++ b/.github/workflows/pr-mirror-repo-sync.yml @@ -0,0 +1,30 @@ +# .github/workflows/pr-mirror-repo-sync.yml +# DO NOT EDIT — managed by mirror-pipeline rollout. +# To opt out: set vars.MIRROR_ENABLED=false in this repo's Actions variables. +name: PR Mirror and Repo Sync + +on: + pull_request_target: + types: [closed] + branches: [current] + workflow_dispatch: + inputs: + sync_branch: + required: true + type: string + +permissions: + contents: write + pull-requests: write + issues: write + +jobs: + call: + if: | + github.repository_owner == 'vyos' + && (github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch') + && vars.MIRROR_ENABLED != 'false' + uses: vyos/.github/.github/workflows/pr-mirror-repo-sync.yml@current + with: + sync_branch: ${{ inputs.sync_branch || github.event.pull_request.base.ref }} + secrets: inherit diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml deleted file mode 100644 index a8eaca777..000000000 --- a/.github/workflows/sonarcloud.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Sonar Checks -on: - push: - branches: - - current - paths: - - '**' - - '!.github/**' - - '!**/*.md' - pull_request_target: - types: [opened, synchronize, reopened] - paths: - - '**' - - '!.github/**' - - '!**/*.md' -jobs: - sonar-cloud: - name: SonarCloud - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - - name: SonarCloud Scan - uses: SonarSource/sonarcloud-github-action@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/.github/workflows/trigger-pr-mirror-repo-sync.yml b/.github/workflows/trigger-pr-mirror-repo-sync.yml deleted file mode 100644 index f74895987..000000000 --- a/.github/workflows/trigger-pr-mirror-repo-sync.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: Trigger Mirror PR and Repo Sync -on: - pull_request_target: - types: - - closed - branches: - - current - -jobs: - call-trigger-mirror-pr-repo-sync: - if: github.repository_owner == 'vyos' && github.event.pull_request.merged == true - uses: vyos/.github/.github/workflows/trigger-pr-mirror-repo-sync.yml@current - secrets: inherit diff --git a/.github/workflows/trigger-rebuild-repo-package.yml b/.github/workflows/trigger-rebuild-repo-package.yml index 37ec83274..e26669bdf 100644 --- a/.github/workflows/trigger-rebuild-repo-package.yml +++ b/.github/workflows/trigger-rebuild-repo-package.yml @@ -6,6 +6,8 @@ on: - closed branches: - current + - circinus + - sagitta workflow_dispatch: jobs: @@ -23,7 +25,7 @@ jobs: needs: get_repo_name uses: vyos/.github/.github/workflows/trigger-rebuild-repo-package.yml@current with: - branch: ${{ github.ref_name }} + branch: ${{ github.event.pull_request.base.ref }} package_name: ${{ needs.get_repo_name.outputs.PACKAGE_NAME }} secrets: REMOTE_OWNER: ${{ secrets.REMOTE_OWNER }} |
