summaryrefslogtreecommitdiff
path: root/.github/workflows
diff options
context:
space:
mode:
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/add-pr-labels.yml4
-rw-r--r--.github/workflows/add-rebase-label.yml14
-rw-r--r--.github/workflows/check-pr-message.yml (renamed from .github/workflows/chceck-pr-message.yml)4
-rw-r--r--.github/workflows/check-unused-imports.yml10
-rw-r--r--.github/workflows/codeql.yml10
-rw-r--r--.github/workflows/package-smoketest.yml112
-rw-r--r--.github/workflows/sonarcloud.yml8
-rw-r--r--.github/workflows/trigger-pr.yml19
8 files changed, 131 insertions, 50 deletions
diff --git a/.github/workflows/add-pr-labels.yml b/.github/workflows/add-pr-labels.yml
index a7ee8446f..a0c076064 100644
--- a/.github/workflows/add-pr-labels.yml
+++ b/.github/workflows/add-pr-labels.yml
@@ -5,10 +5,6 @@ on:
pull_request_target:
branches:
- current
- - crux
- - equuleus
- - sagitta
- - circinus
permissions:
pull-requests: write
diff --git a/.github/workflows/add-rebase-label.yml b/.github/workflows/add-rebase-label.yml
new file mode 100644
index 000000000..9041303af
--- /dev/null
+++ b/.github/workflows/add-rebase-label.yml
@@ -0,0 +1,14 @@
+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/chceck-pr-message.yml b/.github/workflows/check-pr-message.yml
index c567a5934..625ba2d75 100644
--- a/.github/workflows/chceck-pr-message.yml
+++ b/.github/workflows/check-pr-message.yml
@@ -5,10 +5,6 @@ on:
pull_request_target:
branches:
- current
- - crux
- - equuleus
- - sagitta
- - circinus
types: [opened, synchronize, edited]
permissions:
diff --git a/.github/workflows/check-unused-imports.yml b/.github/workflows/check-unused-imports.yml
index 322d4f3a8..76bba94be 100644
--- a/.github/workflows/check-unused-imports.yml
+++ b/.github/workflows/check-unused-imports.yml
@@ -1,14 +1,16 @@
name: Check for unused imports using Pylint
on:
- pull_request:
+ pull_request_target:
branches:
- current
- - equuleus
- - sagitta
- - circinus
+ paths:
+ - '**'
+ - '!.github/**'
+ - '!**/*.md'
workflow_dispatch:
permissions:
+ pull-requests: write
contents: read
jobs:
diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
index 12654e42e..143029c14 100644
--- a/.github/workflows/codeql.yml
+++ b/.github/workflows/codeql.yml
@@ -2,10 +2,18 @@ name: "Perform CodeQL Analysis"
on:
push:
- branches: [ "current", "sagitta", "equuleus", "circinus" ]
+ branches: [ "current" ]
+ paths:
+ - '**'
+ - '!.github/**'
+ - '!**/*.md'
pull_request:
# The branches below must be a subset of the branches above
branches: [ "current" ]
+ paths:
+ - '**'
+ - '!.github/**'
+ - '!**/*.md'
schedule:
- cron: '22 10 * * 0'
diff --git a/.github/workflows/package-smoketest.yml b/.github/workflows/package-smoketest.yml
index 27272a6e2..824cd64b1 100644
--- a/.github/workflows/package-smoketest.yml
+++ b/.github/workflows/package-smoketest.yml
@@ -4,7 +4,10 @@ on:
pull_request_target:
branches:
- current
- - circinus
+ paths:
+ - '**'
+ - '!.github/**'
+ - '!**/*.md'
permissions:
pull-requests: write
@@ -14,7 +17,7 @@ env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed for PR comments
jobs:
- build:
+ build_iso:
runs-on: ubuntu-24.04
timeout-minutes: 45
container:
@@ -42,6 +45,7 @@ jobs:
run: |
echo "build_version=1.5-integration-$(date -u +%Y%m%d%H%M)" >> $GITHUB_OUTPUT
- name: Build custom ISO image
+ shell: bash
run: |
sudo --preserve-env ./build-vyos-image \
--architecture amd64 \
@@ -55,13 +59,15 @@ jobs:
name: vyos-${{ steps.version.outputs.build_version }}
path: build/live-image-amd64.hybrid.iso
- cli-smoketests:
- needs: build
+ test_smoketest_cli:
+ needs: build_iso
runs-on: ubuntu-24.04
timeout-minutes: 180
container:
image: vyos/vyos-build:current
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
@@ -70,27 +76,29 @@ jobs:
repository: vyos/vyos-build
- uses: actions/download-artifact@v4
with:
- name: vyos-${{ needs.build.outputs.build_version }}
+ name: vyos-${{ needs.build_iso.outputs.build_version }}
path: build
- name: VyOS CLI smoketests
- run: sudo make test
- - name: Add PR comment
- if: always()
- uses: mshick/add-pr-comment@v2
- with:
- message-success: '👍 VyOS CLI smoketests finished successfully!'
- message-failure: '❌ VyOS CLI smoketests failed!'
- message-cancelled: '❌ VyOS CLI smoketests cancelled!'
- allow-repeats: false
- refresh-message-position: true
+ id: test
+ shell: bash
+ run: |
+ set -e
+ sudo make test
+ if [[ $? == 0 ]]; then
+ echo "exit_code=success" >> $GITHUB_OUTPUT
+ else
+ echo "exit_code=fail" >> $GITHUB_OUTPUT
+ fi
- config-load-tests:
- needs: build
+ test_config_load:
+ needs: build_iso
runs-on: ubuntu-24.04
timeout-minutes: 90
container:
image: vyos/vyos-build:current
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
@@ -99,27 +107,29 @@ jobs:
repository: vyos/vyos-build
- uses: actions/download-artifact@v4
with:
- name: vyos-${{ needs.build.outputs.build_version }}
+ name: vyos-${{ needs.build_iso.outputs.build_version }}
path: build
- - name: VyOS config tests
- run: sudo make testc
- - name: Add PR comment
- if: always()
- uses: mshick/add-pr-comment@v2
- with:
- message-success: '👍 VyOS config tests finished successfully!'
- message-failure: '❌ VyOS config tests failed!'
- message-cancelled: '❌ VyOS config tests cancelled!'
- allow-repeats: false
- refresh-message-position: true
+ - name: VyOS config load tests
+ id: test
+ shell: bash
+ run: |
+ set -e
+ sudo make testc
+ if [[ $? == 0 ]]; then
+ echo "exit_code=success" >> $GITHUB_OUTPUT
+ else
+ echo "exit_code=fail" >> $GITHUB_OUTPUT
+ fi
- raid1-install-test:
- needs: build
+ test_raid1_install:
+ needs: build_iso
runs-on: ubuntu-24.04
timeout-minutes: 20
container:
image: vyos/vyos-build:current
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
@@ -128,16 +138,44 @@ jobs:
repository: vyos/vyos-build
- uses: actions/download-artifact@v4
with:
- name: vyos-${{ needs.build.outputs.build_version }}
+ name: vyos-${{ needs.build_iso.outputs.build_version }}
path: build
- - name: VyOS RAID1 install test
- run: sudo make testraid
+ - name: VyOS RAID1 installation tests
+ id: test
+ shell: bash
+ run: |
+ set -e
+ sudo make testraid
+ if [[ $? == 0 ]]; then
+ echo "exit_code=success" >> $GITHUB_OUTPUT
+ else
+ echo "exit_code=fail" >> $GITHUB_OUTPUT
+ fi
+
+ result:
+ needs:
+ - test_smoketest_cli
+ - test_config_load
+ - test_raid1_install
+ runs-on: ubuntu-24.04
+ timeout-minutes: 5
+ if: always()
+ steps:
- name: Add PR comment
if: always()
uses: mshick/add-pr-comment@v2
with:
- message-success: '👍 RAID1 Smoketests finished successfully!'
- message-failure: '❌ RAID1 Smoketests failed!'
- message-cancelled: '❌ RAID1 action cancelled!'
+ message: |
+ CI integration ${{ needs.test_smoketest_cli.outputs.exit_code == 'success' && needs.test_config_load.outputs.exit_code == 'success' && needs.test_raid1_install.outputs.exit_code == 'success' && '👍 passed!' || '❌ failed!' }}
+
+ ### Details
+
+ [CI logs](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})
+
+ * CLI Smoketests ${{ needs.test_smoketest_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' }}
+
+ message-id: "SMOKETEST_RESULTS"
allow-repeats: false
refresh-message-position: true
diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml
index 5fa005631..a8eaca777 100644
--- a/.github/workflows/sonarcloud.yml
+++ b/.github/workflows/sonarcloud.yml
@@ -3,8 +3,16 @@ on:
push:
branches:
- current
+ paths:
+ - '**'
+ - '!.github/**'
+ - '!**/*.md'
pull_request_target:
types: [opened, synchronize, reopened]
+ paths:
+ - '**'
+ - '!.github/**'
+ - '!**/*.md'
jobs:
sonar-cloud:
name: SonarCloud
diff --git a/.github/workflows/trigger-pr.yml b/.github/workflows/trigger-pr.yml
new file mode 100644
index 000000000..f88458a81
--- /dev/null
+++ b/.github/workflows/trigger-pr.yml
@@ -0,0 +1,19 @@
+name: Trigger PR
+
+on:
+ pull_request_target:
+ types:
+ - closed
+ branches:
+ - circinus
+
+jobs:
+ trigger-PR:
+ uses: vyos/.github/.github/workflows/trigger-pr.yml@current
+ with:
+ source_branch: 'circinus'
+ target_branch: 'circinus'
+ secrets:
+ REMOTE_REPO: ${{ secrets.REMOTE_REPO }}
+ REMOTE_OWNER: ${{ secrets.REMOTE_OWNER }}
+ PAT: ${{ secrets.PAT }}