blob: 4384a9375bac010973c8e53f358d8489510cc9cc [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:
okozachenko12034371e492023-06-21 16:41:29 +100031 debug:
32 runs-on: ubuntu-20.04-16-cores
okozachenko12030c7392c2023-06-21 16:44:45 +100033 if: github.event_name == 'workflow_dispatch' && inputs.debug_enabled
okozachenko12034371e492023-06-21 16:41:29 +100034 steps:
35 - name: Checkout project
36 uses: actions/checkout@v3
37
38 - name: Install Poetry
39 run: pipx install poetry
40
41 - name: Setup Python
42 uses: actions/setup-python@v4
43 with:
44 cache: poetry
45
46 - name: Install dependencies
47 run: poetry install --no-interaction --with dev
48
49 # NOTE(mnaser): LVM commands take a long time if there are any existing
50 # loop devices created by "snapd", so we uninstall it.
51 - name: Uninstall "snapd"
52 run: sudo apt-get purge -y snapd
53
54 - name: Turn off swap
55 run: sudo swapoff -a
56
57 - name: Run Molecule Converge
58 run: poetry run molecule converge -s ceph
59
60 # Enable tmate debugging of manually-triggered workflows if the input option was provided
61 - name: Setup tmate session
okozachenko12038f959902023-06-21 18:09:00 +100062 if: ${{ failure() }}
okozachenko12034371e492023-06-21 16:41:29 +100063 uses: mxschmitt/action-tmate@v3
okozachenko12038f959902023-06-21 18:09:00 +100064 timeout-minutes: 60
okozachenko12034371e492023-06-21 16:41:29 +100065
66 - name: Run Molecule Destroy
67 run: poetry run molecule destroy -s ceph
68
Mohammed Naser3f961782023-04-20 10:48:21 -040069 test:
70 runs-on: ubuntu-20.04-16-cores
okozachenko12035c3c1492023-06-21 16:55:05 +100071 if: github.event_name != 'workflow_dispatch' || !inputs.debug_enabled
Mohammed Naser54ee9922023-07-22 18:40:25 +000072 strategy:
73 fail-fast: false
74 matrix:
75 ovn:
76 - true
77 - false
Mohammed Naser3f961782023-04-20 10:48:21 -040078 steps:
79 - name: Checkout project
80 uses: actions/checkout@v3
81
82 - name: Install Poetry
83 run: pipx install poetry
84
85 - name: Setup Python
86 uses: actions/setup-python@v4
87 with:
88 cache: poetry
89
90 - name: Install dependencies
91 run: poetry install --no-interaction --with dev
92
93 # NOTE(mnaser): LVM commands take a long time if there are any existing
94 # loop devices created by "snapd", so we uninstall it.
95 - name: Uninstall "snapd"
96 run: sudo apt-get purge -y snapd
97
98 - name: Turn off swap
99 run: sudo swapoff -a
100
101 - name: Run Molecule
102 run: poetry run molecule test -s ceph
Mohammed Naser54ee9922023-07-22 18:40:25 +0000103 env:
104 OVN_ENABLED: ${{ matrix.ovn }}