Skip to content

Commit

Permalink
asdf
Browse files Browse the repository at this point in the history
  • Loading branch information
c-po committed Jul 1, 2024
1 parent 7d91768 commit 35f4593
Showing 1 changed file with 92 additions and 36 deletions.
128 changes: 92 additions & 36 deletions .github/workflows/package-smoketest.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: VyOS ISO integration Test

on:
push:
pull_request_target:
branches:
- current
Expand All @@ -14,7 +15,7 @@ env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed for PR comments

jobs:
build:
build_iso:
runs-on: ubuntu-24.04
timeout-minutes: 45
container:
Expand Down Expand Up @@ -42,6 +43,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 \
Expand All @@ -55,13 +57,16 @@ 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:
error_message: ${{ steps.test.outputs.error_message }}
exit_code: ${{ steps.test.outputs.exit_code }}
steps:
# We need the test script from vyos-build repo
- name: Clone vyos-build source code
Expand All @@ -70,27 +75,31 @@ 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 -o pipefail
sudo make test | tee make-test.log
exit_code=$?
echo "exit_code=$exit_code" >> $GITHUB_OUTPUT
echo "error_message=$(cat make-test.log)" >> $GITHUB_OUTPUT
exit $exit_code
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:
error_message: ${{ steps.test.outputs.error_message }}
exit_code: ${{ steps.test.outputs.exit_code }}
steps:
# We need the test script from vyos-build repo
- name: Clone vyos-build source code
Expand All @@ -99,27 +108,31 @@ 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 -o pipefail
sudo make testc | tee make-testc.log
exit_code=$?
echo "exit_code=$exit_code" >> $GITHUB_OUTPUT
echo "error_message=$(cat make-testc.log)" >> $GITHUB_OUTPUT
raid1-install-test:
needs: build
exit $exit_code
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:
error_message: ${{ steps.test.outputs.error_message }}
exit_code: ${{ steps.test.outputs.exit_code }}
steps:
# We need the test script from vyos-build repo
- name: Clone vyos-build source code
Expand All @@ -128,16 +141,59 @@ 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 -o pipefail
sudo make testraid | tee make-testraid.log
exit_code=$?
echo "exit_code=$exit_code" >> $GITHUB_OUTPUT
echo "error_message=$(cat make-testraid.log)" >> $GITHUB_OUTPUT
exit $exit_code
results:
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: |
${{ needs.test_smoketest_cli.outputs.exit_code == '0' && needs.test_config_load.outputs.exit_code == '0' && needs.test_raid1_install.outputs.exit_code == '0' && '👍 CI integration passed' || '❌ CI integration failed' }}
[CI logs](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})
<details>
## CLI Smoketests
${{ needs.test_smoketest_cli.outputs.error_message }}
${{ needs.test_smoketest_cli.outputs.exit_code }}
## Config tests
${{ needs.test_config_load.outputs.error_message }}
${{ needs.test_config_load.outputs.exit_code }}
## RAID1 tests
${{ needs.test_raid1_install.outputs.error_message }}
${{ needs.test_raid1_install.outputs.exit_code }}
</details>
message-id: "SMOKETEST_RESULTS"
allow-repeats: false
refresh-message-position: true

0 comments on commit 35f4593

Please sign in to comment.