blob: a0e43c63a0798648d4495585c46f3d39c932eea1 [file] [log] [blame]
Mohammed Naser545bc432023-04-16 23:02:23 +00001# 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: csi
16
17on:
18 pull_request:
19 paths:
20 - .github/workflows/csi.yml
21 - molecule/csi/**
22 - playbooks/csi.yml
23 - playbooks/kubernetes.yml
24 - roles/ceph_csi_rbd/**
25 - roles/csi/**
26 - galaxy.yml
27 push:
28 branches:
29 - main
30 paths:
31 - .github/workflows/csi.yml
32 - molecule/csi/**
33 - playbooks/csi.yml
34 - playbooks/kubernetes.yml
35 - roles/ceph_csi_rbd/**
36 - roles/csi/**
37 - galaxy.yml
38
39jobs:
40 test:
41 runs-on: ubuntu-latest
42 strategy:
43 fail-fast: false
44 matrix:
45 driver:
46 - rbd
47 steps:
48 - name: Checkout project
49 uses: actions/checkout@v3
50
51 - name: Install Poetry
52 run: pipx install poetry
53
54 - name: Setup Python
55 uses: actions/setup-python@v4
56 with:
57 cache: poetry
58
59 - name: Install dependencies
60 run: poetry install --no-interaction --with dev
61
62 # NOTE(mnaser): LVM commands take a long time if there are any existing
63 # loop devices created by "snapd", so we uninstall it.
64 - name: Uninstall "snapd"
65 run: sudo apt-get purge -y snapd
66
67 - name: Turn off swap
68 run: sudo swapoff -a
69
70 - name: Run Molecule
71 run: poetry run molecule test -s csi
72 env:
73 MOLECULE_CSI_DRIVER: ${{ matrix.driver }}