summaryrefslogtreecommitdiff
path: root/.github/workflows/package-smoketest.yml
blob: 27272a6e23fbbd4aacb74daf854474ee536bde5b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
name: VyOS ISO integration Test

on:
  pull_request_target:
    branches:
      - current
      - circinus

permissions:
  pull-requests: write
  contents: read

env:
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed for PR comments

jobs:
  build:
    runs-on: ubuntu-24.04
    timeout-minutes: 45
    container:
      image: vyos/vyos-build:current
      options: --sysctl net.ipv6.conf.lo.disable_ipv6=0 --privileged
    env:
      BUILD_BY: autobuild@vyos.net
      DEBIAN_MIRROR: http://deb.debian.org/debian/
    outputs:
      build_version: ${{ steps.version.outputs.build_version }}
    steps:
      - name: Clone vyos-build source code
        uses: actions/checkout@v4
        with:
          repository: vyos/vyos-build
      - name: Clone vyos-1x source code
        uses: actions/checkout@v4
        with:
          path: packages/vyos-1x
      - name: Build vyos-1x package
        run: |
          cd packages/vyos-1x; 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
      - name: Build custom ISO image
        run: |
          sudo --preserve-env ./build-vyos-image \
          --architecture amd64 \
          --build-by $BUILD_BY \
          --debian-mirror $DEBIAN_MIRROR \
          --version ${{ steps.version.outputs.build_version }} \
          --build-type release \
          generic
      - uses: actions/upload-artifact@v4
        with:
          name: vyos-${{ steps.version.outputs.build_version }}
          path: build/live-image-amd64.hybrid.iso

  cli-smoketests:
    needs: build
    runs-on: ubuntu-24.04
    timeout-minutes: 180
    container:
      image: vyos/vyos-build:current
      options: --sysctl net.ipv6.conf.lo.disable_ipv6=0 --privileged
    steps:
      # We need the test script from vyos-build repo
      - name: Clone vyos-build source code
        uses: actions/checkout@v4
        with:
          repository: vyos/vyos-build
      - uses: actions/download-artifact@v4
        with:
          name: vyos-${{ needs.build.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

  config-load-tests:
    needs: build
    runs-on: ubuntu-24.04
    timeout-minutes: 90
    container:
      image: vyos/vyos-build:current
      options: --sysctl net.ipv6.conf.lo.disable_ipv6=0 --privileged
    steps:
      # We need the test script from vyos-build repo
      - name: Clone vyos-build source code
        uses: actions/checkout@v4
        with:
          repository: vyos/vyos-build
      - uses: actions/download-artifact@v4
        with:
          name: vyos-${{ needs.build.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

  raid1-install-test:
    needs: build
    runs-on: ubuntu-24.04
    timeout-minutes: 20
    container:
      image: vyos/vyos-build:current
      options: --sysctl net.ipv6.conf.lo.disable_ipv6=0 --privileged
    steps:
      # We need the test script from vyos-build repo
      - name: Clone vyos-build source code
        uses: actions/checkout@v4
        with:
          repository: vyos/vyos-build
      - uses: actions/download-artifact@v4
        with:
          name: vyos-${{ needs.build.outputs.build_version }}
          path: build
      - name: VyOS RAID1 install test
        run: sudo make testraid
      - 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!'
          allow-repeats: false
          refresh-message-position: true