-
Notifications
You must be signed in to change notification settings - Fork 8
70 lines (67 loc) · 2.18 KB
/
ansible-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
---
name: Ansible test
on:
push:
paths:
- "meta/**"
- "plugins/**"
- "roles/**"
- "tests/**"
- "*requirements*"
- "*.py"
- "*ansible*"
# pull_request:
schedule:
- cron: "0 6 * * *"
env:
NAMESPACE: scale_computing
COLLECTION_NAME: hypercore
# ANSIBLE_TEST_PREFER_PODMAN: 1
jobs:
sanity:
name: sanity test
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Perform sanity testing with ansible-test
uses: ansible-community/ansible-test-gh-action@release/v1
with:
ansible-core-version: stable-2.16
target-python-version: 3.11
testing-type: sanity
get_matrix:
outputs:
version_matrix: ${{ steps.set-matrix.outputs.version_matrix }}
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- run: python -c "import json, yaml; print('version_matrix=' + json.dumps(yaml.safe_load(open('.github/workflows/files/ansible-test-units-matrix.yml'))))"
- id: set-matrix
name: set version_matrix output
# run: echo "::set-output name=matrix::{\"node\":[10, 12, 14]}"
run: python -c "import json, yaml; print('version_matrix=' + json.dumps(yaml.safe_load(open('.github/workflows/files/ansible-test-units-matrix.yml'))))" >> $GITHUB_OUTPUT
- run: cat $GITHUB_OUTPUT
units:
needs: get_matrix
name: units ${{ matrix.ansible }}-py${{ matrix.python }}
strategy:
fail-fast: false
matrix:
include: ${{ fromJSON(needs.get_matrix.outputs.version_matrix) }}
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Perform units testing with ansible-test
uses: ansible-community/ansible-test-gh-action@release/v1
with:
ansible-core-version: ${{ matrix.ansible }}
target-python-version: ${{ matrix.python }}
testing-type: units
import-galaxy-test:
permissions:
contents: read
name: Import collection with Galaxy importer
uses: ansible-community/github-action-test-galaxy-import/.github/workflows/test-galaxy-import.yml@main