blob: 93f7b64e13396f08ac9da14a5fa5656a9a0233f4 [file] [log] [blame]
Mohammed Naser3f961782023-04-20 10:48:21 -04001# Copyright (c) 2023 VEXXHOST, Inc.
2#
3# Licensed under the Apache License, Version 2.0 (the "License"); you may
4# not use this file except in compliance with the License. You may obtain
5# a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12# License for the specific language governing permissions and limitations
13# under the License.
14
15name: ceph
16
17on:
18 pull_request:
19 push:
20 branches:
21 - main
okozachenko12034371e492023-06-21 16:41:29 +100022 workflow_dispatch:
23 inputs:
24 debug_enabled:
25 type: boolean
26 description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
27 required: false
28 default: false
Mohammed Naser3f961782023-04-20 10:48:21 -040029
30jobs:
Mohammed Naser1d75a922023-07-23 19:24:49 +000031 debug:
Mohammed Naser727b5b62023-07-22 19:21:00 +000032 runs-on: ubuntu-20.04-16-cores
Mohammed Naser1d75a922023-07-23 19:24:49 +000033 if: github.event_name == 'workflow_dispatch' && inputs.debug_enabled
34 strategy:
35 fail-fast: false
36 matrix:
37 network_backend:
38 - openvswitch
39 - ovn
Mohammed Naser727b5b62023-07-22 19:21:00 +000040 steps:
41 - name: Checkout project
42 uses: actions/checkout@v3
43
44 - name: Install Poetry
45 run: pipx install poetry
46
47 - name: Setup Python
48 uses: actions/setup-python@v4
49 with:
50 cache: poetry
51
52 - name: Install dependencies
53 run: poetry install --no-interaction --with dev
54
55 # NOTE(mnaser): LVM commands take a long time if there are any existing
56 # loop devices created by "snapd", so we uninstall it.
57 - name: Uninstall "snapd"
58 run: sudo apt-get purge -y snapd
59
60 - name: Turn off swap
61 run: sudo swapoff -a
62
63 - name: Run Molecule Converge
64 run: poetry run molecule converge -s ceph
Mohammed Naser727b5b62023-07-22 19:21:00 +000065
66 # Enable tmate debugging of manually-triggered workflows if the input option was provided
67 - name: Setup tmate session
68 if: ${{ failure() }}
69 uses: mxschmitt/action-tmate@v3
Mohammed Naser1d75a922023-07-23 19:24:49 +000070 timeout-minutes: 60
Mohammed Naser727b5b62023-07-22 19:21:00 +000071
72 - name: Run Molecule Destroy
73 run: poetry run molecule destroy -s ceph
74
Mohammed Naser1d75a922023-07-23 19:24:49 +000075 test:
76 runs-on: ubuntu-20.04-16-cores
77 if: github.event_name != 'workflow_dispatch' || !inputs.debug_enabled
78 strategy:
79 fail-fast: false
80 matrix:
81 network_backend:
82 - openvswitch
83 - ovn
84 steps:
85 - name: Checkout project
86 uses: actions/checkout@v3
Mohammed Naser3f961782023-04-20 10:48:21 -040087
Mohammed Naser1d75a922023-07-23 19:24:49 +000088 - name: Install Poetry
89 run: pipx install poetry
Mohammed Naser3f961782023-04-20 10:48:21 -040090
Mohammed Naser1d75a922023-07-23 19:24:49 +000091 - name: Setup Python
92 uses: actions/setup-python@v4
93 with:
94 cache: poetry
Mohammed Naser3f961782023-04-20 10:48:21 -040095
Mohammed Naser1d75a922023-07-23 19:24:49 +000096 - name: Install dependencies
97 run: poetry install --no-interaction --with dev
Mohammed Naser3f961782023-04-20 10:48:21 -040098
Mohammed Naser1d75a922023-07-23 19:24:49 +000099 # NOTE(mnaser): LVM commands take a long time if there are any existing
100 # loop devices created by "snapd", so we uninstall it.
101 - name: Uninstall "snapd"
102 run: sudo apt-get purge -y snapd
Mohammed Naser3f961782023-04-20 10:48:21 -0400103
Mohammed Naser1d75a922023-07-23 19:24:49 +0000104 - name: Turn off swap
105 run: sudo swapoff -a
Mohammed Naser3f961782023-04-20 10:48:21 -0400106
Mohammed Naser1d75a922023-07-23 19:24:49 +0000107 - name: Run Molecule
108 run: poetry run molecule test -s ceph
109 env:
110 ATMOSPHERE_NETWORK_BACKEND: ${{ matrix.network_backend }}