blob: 90ff80566e28d66dd7c1a0980505835631fdd19b [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:
Mohammed Naser1581a352023-04-17 02:28:10 +000046 - local-path-provisioner
Mohammed Naser545bc432023-04-16 23:02:23 +000047 - rbd
48 steps:
49 - name: Checkout project
50 uses: actions/checkout@v3
51
52 - name: Install Poetry
53 run: pipx install poetry
54
55 - name: Setup Python
56 uses: actions/setup-python@v4
57 with:
58 cache: poetry
59
60 - name: Install dependencies
61 run: poetry install --no-interaction --with dev
62
63 # NOTE(mnaser): LVM commands take a long time if there are any existing
64 # loop devices created by "snapd", so we uninstall it.
65 - name: Uninstall "snapd"
66 run: sudo apt-get purge -y snapd
67
68 - name: Turn off swap
69 run: sudo swapoff -a
70
71 - name: Run Molecule
72 run: poetry run molecule test -s csi
73 env:
74 MOLECULE_CSI_DRIVER: ${{ matrix.driver }}