-
Notifications
You must be signed in to change notification settings - Fork 3
44 lines (43 loc) · 1.39 KB
/
main.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
---
name: Molecule Test
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
matrix:
python-version: [3.9]
steps:
- uses: actions/checkout@v3
with:
path: "${{ github.repository }}"
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install molecule==5.1.0 ansible-core
- name: Test with molecule
run: |
ansible-galaxy collection install ansible.posix
ansible-galaxy collection install community.general
ansible-galaxy collection install ansible.utils
mkdir -p ~/.ssh/
echo "$SSH_PRIVATE_KEY" > ~/.ssh/private.key
sudo chmod 600 ~/.ssh/private.key
echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
eval `ssh-agent -s`
echo PUBLIC_IP=${PUBLIC_IP}
ssh-add ~/.ssh/private.key
molecule drivers
find . -name molecule
cd ./IBM/ansible-power-linux-sap/
molecule test
shell: bash
env:
SSH_PRIVATE_KEY: ${{secrets.SAH_PRIVATE_KEY}}
SSH_KNOWN_HOSTS: ${{secrets.SSH_KNOWN_HOSTS}}
PUBLIC_IP: ${{secrets.PUBLIC_IP}}