blob: ea5638c6888b5728726f470026b545dcadc1a31d [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 Naserf1597e62023-07-23 20:36:49 +000040 concurrency:
41 group: ${{ github.ref }}-${{ matrix.network_backend }}
42 cancel-in-progress: true
Mohammed Naser727b5b62023-07-22 19:21:00 +000043 steps:
44 - name: Checkout project
45 uses: actions/checkout@v3
46
47 - name: Install Poetry
48 run: pipx install poetry
49
50 - name: Setup Python
51 uses: actions/setup-python@v4
52 with:
53 cache: poetry
54
55 - name: Install dependencies
56 run: poetry install --no-interaction --with dev
57
58 # NOTE(mnaser): LVM commands take a long time if there are any existing
59 # loop devices created by "snapd", so we uninstall it.
60 - name: Uninstall "snapd"
61 run: sudo apt-get purge -y snapd
62
63 - name: Turn off swap
64 run: sudo swapoff -a
65
66 - name: Run Molecule Converge
67 run: poetry run molecule converge -s ceph
Mohammed Naser727b5b62023-07-22 19:21:00 +000068
69 # Enable tmate debugging of manually-triggered workflows if the input option was provided
70 - name: Setup tmate session
71 if: ${{ failure() }}
72 uses: mxschmitt/action-tmate@v3
Mohammed Naser1d75a922023-07-23 19:24:49 +000073 timeout-minutes: 60
Mohammed Naser727b5b62023-07-22 19:21:00 +000074
75 - name: Run Molecule Destroy
76 run: poetry run molecule destroy -s ceph
77
Mohammed Naser1d75a922023-07-23 19:24:49 +000078 test:
79 runs-on: ubuntu-20.04-16-cores
80 if: github.event_name != 'workflow_dispatch' || !inputs.debug_enabled
81 strategy:
82 fail-fast: false
83 matrix:
84 network_backend:
85 - openvswitch
86 - ovn
Mohammed Naserf1597e62023-07-23 20:36:49 +000087 concurrency:
88 group: ${{ github.ref }}-${{ matrix.network_backend }}
89 cancel-in-progress: true
Mohammed Naser1d75a922023-07-23 19:24:49 +000090 steps:
91 - name: Checkout project
92 uses: actions/checkout@v3
Mohammed Naser3f961782023-04-20 10:48:21 -040093
Mohammed Naser1d75a922023-07-23 19:24:49 +000094 - name: Install Poetry
95 run: pipx install poetry
Mohammed Naser3f961782023-04-20 10:48:21 -040096
Mohammed Naser1d75a922023-07-23 19:24:49 +000097 - name: Setup Python
98 uses: actions/setup-python@v4
99 with:
100 cache: poetry
Mohammed Naser3f961782023-04-20 10:48:21 -0400101
Mohammed Naser1d75a922023-07-23 19:24:49 +0000102 - name: Install dependencies
103 run: poetry install --no-interaction --with dev
Mohammed Naser3f961782023-04-20 10:48:21 -0400104
Mohammed Naser1d75a922023-07-23 19:24:49 +0000105 # NOTE(mnaser): LVM commands take a long time if there are any existing
106 # loop devices created by "snapd", so we uninstall it.
107 - name: Uninstall "snapd"
108 run: sudo apt-get purge -y snapd
Mohammed Naser3f961782023-04-20 10:48:21 -0400109
Mohammed Naser1d75a922023-07-23 19:24:49 +0000110 - name: Turn off swap
111 run: sudo swapoff -a
Mohammed Naser3f961782023-04-20 10:48:21 -0400112
Mohammed Naser1d75a922023-07-23 19:24:49 +0000113 - name: Run Molecule
114 run: poetry run molecule test -s ceph
115 env:
116 ATMOSPHERE_NETWORK_BACKEND: ${{ matrix.network_backend }}