|
9 | 9 | - cron: "0 10 * * 1" # every Monday at 10:00 UTC |
10 | 10 |
|
11 | 11 | jobs: |
12 | | - legacy-sanity: |
13 | | - name: Ansible Sanity Tests (Python 2.7) |
14 | | - runs-on: ubuntu-latest |
15 | | - container: |
16 | | - image: python:2.7 |
17 | | - steps: |
18 | | - - name: Checkout code |
19 | | - uses: actions/checkout@v4 |
20 | | - |
21 | | - - name: Fix collection path for ansible-test # should be removed once we restructure |
22 | | - run: | |
23 | | - mkdir -p ansible_collections/ravendb/ravendb |
24 | | - tar --exclude=ansible_collections -cf - . | tar -C ansible_collections/ravendb/ravendb -xf - |
25 | | - cd ansible_collections/ravendb/ravendb |
26 | | -
|
27 | | - - name: Install dependencies |
28 | | - run: | |
29 | | - python -m pip install --upgrade pip |
30 | | - pip install "ansible-core@https://github.com/ansible/ansible/archive/stable-2.9.tar.gz" |
31 | | -
|
32 | | - - name: Run ansible-test sanity |
33 | | - working-directory: ansible_collections/ravendb/ravendb |
34 | | - run: | |
35 | | - ansible-test sanity --python 2.7 -v --color |
36 | | - |
37 | | - sanity: |
38 | | - name: Ansible Sanity Tests |
| 12 | + # sanity: |
| 13 | + # name: Ansible Sanity Tests |
| 14 | + # runs-on: ubuntu-latest |
| 15 | + # strategy: |
| 16 | + # matrix: |
| 17 | + # include: |
| 18 | + # - python-version: "3.12" |
| 19 | + # ansible-core: stable-2.16 |
| 20 | + # - python-version: "3.12" |
| 21 | + # ansible-core: stable-2.17 |
| 22 | + # - python-version: "3.13" |
| 23 | + # ansible-core: stable-2.18 |
| 24 | + # - python-version: "3.13" |
| 25 | + # ansible-core: stable-2.19 |
| 26 | + # - python-version: "3.13" |
| 27 | + # ansible-core: devel |
| 28 | + # steps: |
| 29 | + # - name: Checkout code |
| 30 | + # uses: actions/checkout@v4 |
| 31 | + |
| 32 | + # - name: Fix collection path for ansible-test |
| 33 | + # run: | |
| 34 | + # mkdir -p ansible_collections/ravendb/ravendb |
| 35 | + # rsync -av --exclude ansible_collections ./ ansible_collections/ravendb/ravendb |
| 36 | + # cd ansible_collections/ravendb/ravendb |
| 37 | + |
| 38 | + # - name: Set up Python (host) |
| 39 | + # uses: actions/setup-python@v5 |
| 40 | + # with: |
| 41 | + # python-version: ${{ matrix.python-version }} |
| 42 | + |
| 43 | + # - name: Install dependencies |
| 44 | + # run: | |
| 45 | + # python -m pip install --upgrade pip |
| 46 | + # pip install "ansible-core@https://github.com/ansible/ansible/archive/${{ matrix.ansible-core }}.tar.gz" |
| 47 | + |
| 48 | + # - name: Run ansible-test sanity |
| 49 | + # working-directory: ansible_collections/ravendb/ravendb |
| 50 | + # run: | |
| 51 | + # ansible-test sanity --docker -v --color |
| 52 | + |
| 53 | + integration-and-unit: |
| 54 | + name: Integration + Unit Tests |
39 | 55 | runs-on: ubuntu-latest |
40 | 56 | strategy: |
41 | 57 | matrix: |
42 | 58 | include: |
43 | | - - python-version: "3.10" |
44 | | - ansible-core: stable-2.16 |
45 | | - - python-version: "3.11" |
46 | | - ansible-core: stable-2.16 |
47 | | - - python-version: "3.12" |
48 | | - ansible-core: stable-2.16 |
49 | | - |
50 | | - - python-version: "3.10" |
51 | | - ansible-core: stable-2.17 |
52 | | - - python-version: "3.11" |
53 | | - ansible-core: stable-2.17 |
54 | | - - python-version: "3.12" |
55 | | - ansible-core: stable-2.17 |
56 | | - |
57 | | - - python-version: "3.11" |
58 | | - ansible-core: stable-2.18 |
59 | | - - python-version: "3.12" |
60 | | - ansible-core: stable-2.18 |
61 | | - - python-version: "3.13" |
62 | | - ansible-core: stable-2.18 |
63 | | - |
| 59 | + # - python-version: "3.10" |
| 60 | + # ansible-core: stable-2.16 |
| 61 | + # - python-version: "3.11" |
| 62 | + # ansible-core: stable-2.16 |
| 63 | + # - python-version: "3.12" |
| 64 | + # ansible-core: stable-2.16 |
| 65 | + # - python-version: "3.10" |
| 66 | + # ansible-core: stable-2.17 |
| 67 | + # - python-version: "3.11" |
| 68 | + # ansible-core: stable-2.17 |
| 69 | + # - python-version: "3.12" |
| 70 | + # ansible-core: stable-2.17 |
| 71 | + # - python-version: "3.11" |
| 72 | + # ansible-core: stable-2.18 |
| 73 | + # - python-version: "3.12" |
| 74 | + # ansible-core: stable-2.18 |
| 75 | + # - python-version: "3.13" |
| 76 | + # ansible-core: stable-2.18 |
64 | 77 | - python-version: "3.11" |
65 | 78 | ansible-core: stable-2.19 |
66 | 79 | - python-version: "3.12" |
67 | 80 | ansible-core: stable-2.19 |
68 | 81 | - python-version: "3.13" |
69 | 82 | ansible-core: stable-2.19 |
70 | | - |
71 | | - - python-version: "3.11" |
72 | | - ansible-core: devel |
73 | 83 | - python-version: "3.12" |
74 | 84 | ansible-core: devel |
75 | 85 | - python-version: "3.13" |
76 | 86 | ansible-core: devel |
| 87 | + |
77 | 88 | steps: |
78 | 89 | - name: Checkout code |
79 | 90 | uses: actions/checkout@v4 |
80 | 91 |
|
81 | | - - name: Fix collection path for ansible-test #should be removed once we restructre |
| 92 | + - name: Fix collection path for ansible-test |
82 | 93 | run: | |
83 | 94 | mkdir -p ansible_collections/ravendb/ravendb |
84 | 95 | rsync -av --exclude ansible_collections ./ ansible_collections/ravendb/ravendb |
85 | 96 | cd ansible_collections/ravendb/ravendb |
86 | | - |
87 | | - - name: Set up Python ${{ matrix.python-version }} |
| 97 | +
|
| 98 | + - name: Set up Python (host) |
88 | 99 | uses: actions/setup-python@v5 |
89 | 100 | with: |
90 | 101 | python-version: ${{ matrix.python-version }} |
91 | 102 |
|
92 | | - - name: Install dependencies |
| 103 | + - name: Install ASP.NET Core Runtime |
93 | 104 | run: | |
94 | | - python -m pip install --upgrade pip |
95 | | - pip install "ansible-core@https://github.com/ansible/ansible/archive/${{ matrix.ansible-core }}.tar.gz" |
| 105 | + wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh |
| 106 | + chmod +x dotnet-install.sh |
| 107 | + ./dotnet-install.sh --runtime aspnetcore --channel 8.0 |
96 | 108 |
|
97 | | - - name: Run ansible-test sanity |
98 | | - working-directory: ansible_collections/ravendb/ravendb |
| 109 | + - name: Uninstall old Molecule plugins |
99 | 110 | run: | |
100 | | - ansible-test sanity --python ${{ matrix.python-version }} --docker -v --color |
101 | | - |
102 | | - test-debian-setup-scenarios: |
103 | | - runs-on: ubuntu-latest |
104 | | - steps: |
105 | | - - name: Checkout code |
106 | | - uses: actions/checkout@v4 |
107 | | - |
108 | | - - name: Set up Python 3 |
109 | | - uses: actions/setup-python@v2 |
110 | | - with: |
111 | | - python-version: "3.x" |
112 | | - |
113 | | - - name: Cache pip dependencies |
114 | | - uses: actions/cache@v4 |
115 | | - with: |
116 | | - path: ~/.cache/pip |
117 | | - key: ${{ runner.os }}-pip |
118 | | - restore-keys: | |
119 | | - ${{ runner.os }}-pip- |
| 111 | + pip uninstall -y molecule-docker molecule molecule-plugins[docker] community.docker docker |
120 | 112 |
|
121 | 113 | - name: Install dependencies |
| 114 | + env: |
| 115 | + ANSIBLE_COLLECTIONS_PATHS: ~/.ansible/collections:/usr/share/ansible/collections |
122 | 116 | run: | |
123 | 117 | python -m pip install --upgrade pip |
124 | | - pip install ansible molecule molecule-docker docker |
| 118 | + pip install "ansible-core@https://github.com/ansible/ansible/archive/${{ matrix.ansible-core }}.tar.gz" |
| 119 | + pip install molecule molecule-plugins[docker] docker ravendb_test_driver |
| 120 | + ansible-galaxy collection install community.docker ansible.posix community.general |
| 121 | +
|
| 122 | + - name: Patch Molecule docker plugin for Ansible 2.19 or devel |
| 123 | + if: matrix.ansible-core == 'stable-2.19' || startsWith(matrix.ansible-core, 'devel') |
| 124 | + run: | |
| 125 | + for f in destroy.yml create.yml; do |
| 126 | + sed -i "s#(lookup('env', 'HOME'))#lookup('env', 'HOME') | bool#" \ |
| 127 | + $(python -c "import molecule_plugins.docker as d, os; print(os.path.join(os.path.dirname(d.__file__), 'playbooks', '$f'))") |
| 128 | + done |
125 | 129 |
|
126 | 130 | - name: Set ansible roles path |
127 | 131 | run: echo "ANSIBLE_ROLES_PATH=$GITHUB_WORKSPACE/roles" >> $GITHUB_ENV |
128 | 132 |
|
129 | | - - name: Run molecule unsecured scenario |
| 133 | + - name: Run Debian unsecured scenario |
130 | 134 | working-directory: roles/ravendb_node |
131 | 135 | run: molecule test -s unsecured |
132 | | - |
133 | | - - name: Run molecule update scenario |
| 136 | + |
| 137 | + - name: Run Debian update scenario |
134 | 138 | working-directory: roles/ravendb_node |
135 | 139 | run: molecule test -s update |
136 | 140 |
|
137 | | - - name: Run molecule clenaup scenario |
| 141 | + - name: Run Debian cleanup scenario |
138 | 142 | working-directory: roles/ravendb_node |
139 | 143 | run: molecule test -s cleanup |
140 | 144 |
|
141 | | - test-rhel-setup-scenarios: |
142 | | - runs-on: ubuntu-latest |
143 | | - steps: |
144 | | - - name: Checkout code |
145 | | - uses: actions/checkout@v4 |
146 | | - |
147 | | - - name: Set up Python 3 |
148 | | - uses: actions/setup-python@v2 |
149 | | - with: |
150 | | - python-version: "3.x" |
151 | | - |
152 | | - - name: Cache pip dependencies |
153 | | - uses: actions/cache@v4 |
154 | | - with: |
155 | | - path: ~/.cache/pip |
156 | | - key: ${{ runner.os }}-pip |
157 | | - restore-keys: | |
158 | | - ${{ runner.os }}-pip- |
159 | | -
|
160 | | - - name: Install dependencies |
161 | | - run: | |
162 | | - python -m pip install --upgrade pip |
163 | | - pip install ansible molecule molecule-docker docker |
164 | | -
|
165 | | - - name: Set ansible roles path |
166 | | - run: echo "ANSIBLE_ROLES_PATH=$GITHUB_WORKSPACE/roles" >> $GITHUB_ENV |
167 | | - |
168 | | - - name: Run molecule unsecured-rhel scenario |
169 | | - working-directory: roles/ravendb_node |
170 | | - run: molecule test -s unsecured-rhel |
| 145 | + - name: Run RHEL unsecured scenario |
| 146 | + working-directory: roles/ravendb_node |
| 147 | + run: molecule test -s unsecured-rhel |
| 148 | + |
| 149 | + - name: Run RHEL update scenario |
| 150 | + working-directory: roles/ravendb_node |
| 151 | + run: molecule test -s update-rhel |
| 152 | + |
| 153 | + - name: Run RHEL cleanup scenario |
| 154 | + working-directory: roles/ravendb_node |
| 155 | + run: molecule test -s cleanup-rhel |
| 156 | + |
| 157 | + # Unit tests |
| 158 | + - name: Build ansible galaxy collection |
| 159 | + run: | |
| 160 | + ansible-galaxy collection build . |
| 161 | + ansible-galaxy collection install ./ravendb-ravendb-*.tar.gz --force -p ./ |
| 162 | +
|
| 163 | + - name: Set up .NET environment variables |
| 164 | + run: | |
| 165 | + export DOTNET_ROOT=$HOME/.dotnet |
| 166 | + export PATH=$PATH:$HOME/.dotnet |
| 167 | + source ~/.bashrc |
| 168 | +
|
| 169 | + - name: Change to ravendb_node role directory |
| 170 | + run: cd roles/ravendb_node |
171 | 171 |
|
172 | | - - name: Run molecule update-rhel scenario |
173 | | - working-directory: roles/ravendb_node |
174 | | - run: molecule test -s update-rhel |
175 | | - |
176 | | - - name: Run molecule clenaup-rhel scenario |
177 | | - working-directory: roles/ravendb_node |
178 | | - run: molecule test -s cleanup-rhel |
179 | | - |
180 | | - test-ravendb-modules: |
181 | | - runs-on: ubuntu-latest |
182 | | - steps: |
183 | | - - name: Checkout code |
184 | | - uses: actions/checkout@v4 |
185 | | - |
186 | | - - name: Set up Python 3 |
187 | | - uses: actions/setup-python@v2 |
188 | | - with: |
189 | | - python-version: "3.x" |
190 | | - |
191 | | - - name: Cache pip dependencies |
192 | | - uses: actions/cache@v4 |
193 | | - with: |
194 | | - path: ~/.cache/pip |
195 | | - key: ${{ runner.os }}-pip |
196 | | - restore-keys: | |
197 | | - ${{ runner.os }}-pip- |
198 | | -
|
199 | | - - name: Install ASP.NET Core Runtime |
200 | | - run: | |
201 | | - wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh |
202 | | - chmod +x dotnet-install.sh |
203 | | - ./dotnet-install.sh --runtime aspnetcore --channel 8.0 |
204 | | -
|
205 | | - - name: Install dependencies |
206 | | - run: | |
207 | | - python -m pip install --upgrade pip |
208 | | - pip install ansible molecule molecule-docker docker ravendb_test_driver |
209 | | -
|
210 | | - - name: Build ansible galaxy collection |
211 | | - run: | |
212 | | - ansible-galaxy collection build . |
213 | | - ansible-galaxy collection install ./ravendb-ravendb-*.tar.gz --force -p ./ |
214 | | -
|
215 | | - - name: Set up .NET environment variables |
216 | | - run: | |
217 | | - export DOTNET_ROOT=$HOME/.dotnet |
218 | | - export PATH=$PATH:$HOME/.dotnet |
219 | | - source ~/.bashrc |
220 | | -
|
221 | | - - name: Change to ravendb_node role directory |
222 | | - run: cd roles/ravendb_node |
223 | | - |
224 | | - - name: Run modules unit tests |
225 | | - run: python3 -m unittest discover -s tests/unit -v |
| 172 | + - name: Run modules unit tests |
| 173 | + run: python3 -m unittest discover -s tests/unit -v |
0 commit comments