Skip to content

Commit 6889eaf

Browse files
committed
github actions test
Signed-off-by: Jesus Paz <[email protected]>
1 parent e719212 commit 6889eaf

File tree

4 files changed

+162
-7
lines changed

4 files changed

+162
-7
lines changed

.github/workflows/ci.yml

Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
name: Ansible Playbook Execution
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
run-playbook-ubuntu-amd64:
16+
runs-on: ubuntu-latest
17+
strategy:
18+
matrix:
19+
ubuntu_version: [noble, jammy, focal]
20+
node_version: [18.x, 20.x, 22.x]
21+
container:
22+
image: ubuntu:${{ matrix.ubuntu_version }}
23+
steps:
24+
- uses: actions/checkout@v4
25+
- name: Install Dependencies
26+
run: |
27+
apt-get update
28+
apt-get install -y lsb-release sudo curl python3 python3-pip python3-venv
29+
- name: Setup Virtual Environment
30+
run: |
31+
python3 -m venv venv
32+
./venv/bin/pip install --upgrade pip
33+
- name: Install Ansible and Requirements
34+
run: |
35+
./venv/bin/pip install -r requirements.txt
36+
./venv/bin/pip install ansible
37+
- name: Run Playbook
38+
run: |
39+
ANSIBLE_ROLES_PATH=../ ./venv/bin/ansible-playbook playbook.yml --extra-vars "nodejs_version=${{ matrix.node_version }}" --ask-become-pass
40+
- name: Check Installed Node.js Version
41+
shell: bash
42+
run: |
43+
NODE_VERSION_INSTALLED=$(node -v | cut -d. -f1 | sed 's/v//')
44+
NODE_VERSION_EXPECTED=$(echo "${{ matrix.node_version }}" | cut -d. -f1)
45+
if [[ "$NODE_VERSION_INSTALLED" != "$NODE_VERSION_EXPECTED" ]]; then
46+
echo "Node.js version mismatch: expected $NODE_VERSION_EXPECTED, got $NODE_VERSION_INSTALLED"
47+
exit 1
48+
else
49+
echo "Node.js version correctly installed: $NODE_VERSION_INSTALLED"
50+
fi
51+
52+
run-playbook-debian-amd64:
53+
runs-on: ubuntu-latest
54+
strategy:
55+
matrix:
56+
debian_version: [bullseye, bookworm]
57+
node_version: [18.x, 20.x, 22.x]
58+
container:
59+
image: debian:${{ matrix.debian_version }}
60+
steps:
61+
- uses: actions/checkout@v4
62+
- name: Install Dependencies
63+
run: |
64+
apt-get update
65+
apt-get install -y lsb-release sudo curl python3 python3-pip python3-venv
66+
- name: Setup Virtual Environment
67+
run: |
68+
python3 -m venv venv
69+
./venv/bin/pip install --upgrade pip
70+
- name: Install Ansible and Requirements
71+
run: |
72+
./venv/bin/pip install -r requirements.txt
73+
./venv/bin/pip install ansible
74+
- name: Run Playbook
75+
run: |
76+
ANSIBLE_ROLES_PATH=../ ./venv/bin/ansible-playbook playbook.yml --extra-vars "nodejs_version=${{ matrix.node_version }}" --ask-become-pass
77+
- name: Check Installed Node.js Version
78+
shell: bash
79+
run: |
80+
NODE_VERSION_INSTALLED=$(node -v | cut -d. -f1 | sed 's/v//')
81+
NODE_VERSION_EXPECTED=$(echo "${{ matrix.node_version }}" | cut -d. -f1)
82+
if [[ "$NODE_VERSION_INSTALLED" != "$NODE_VERSION_EXPECTED" ]]; then
83+
echo "Node.js version mismatch: expected $NODE_VERSION_EXPECTED, got $NODE_VERSION_INSTALLED"
84+
exit 1
85+
else
86+
echo "Node.js version correctly installed: $NODE_VERSION_INSTALLED"
87+
fi
88+
89+
run-playbook-ubuntu-arm64:
90+
runs-on: ubuntu-22.04-arm
91+
strategy:
92+
matrix:
93+
ubuntu_version: [noble, jammy, focal]
94+
node_version: [18.x, 20.x, 22.x]
95+
container:
96+
image: ubuntu:${{ matrix.ubuntu_version }}
97+
steps:
98+
- uses: actions/checkout@v4
99+
- name: Install Dependencies
100+
run: |
101+
apt-get update
102+
apt-get install -y lsb-release sudo curl python3 python3-pip python3-venv
103+
- name: Setup Virtual Environment
104+
run: |
105+
python3 -m venv venv
106+
./venv/bin/pip install --upgrade pip
107+
- name: Install Ansible and Requirements
108+
run: |
109+
./venv/bin/pip install -r requirements.txt
110+
./venv/bin/pip install ansible
111+
- name: Run Playbook
112+
run: |
113+
ANSIBLE_ROLES_PATH=../ ./venv/bin/ansible-playbook playbook.yml --extra-vars "nodejs_version=${{ matrix.node_version }}" --ask-become-pass
114+
- name: Check Installed Node.js Version
115+
shell: bash
116+
run: |
117+
NODE_VERSION_INSTALLED=$(node -v | cut -d. -f1 | sed 's/v//')
118+
NODE_VERSION_EXPECTED=$(echo "${{ matrix.node_version }}" | cut -d. -f1)
119+
if [[ "$NODE_VERSION_INSTALLED" != "$NODE_VERSION_EXPECTED" ]]; then
120+
echo "Node.js version mismatch: expected $NODE_VERSION_EXPECTED, got $NODE_VERSION_INSTALLED"
121+
exit 1
122+
else
123+
echo "Node.js version correctly installed: $NODE_VERSION_INSTALLED"
124+
fi
125+
126+
run-playbook-debian-arm64:
127+
runs-on: ubuntu-22.04-arm
128+
strategy:
129+
matrix:
130+
debian_version: [bullseye, bookworm]
131+
node_version: [18.x, 20.x, 22.x]
132+
container:
133+
image: debian:${{ matrix.debian_version }}
134+
steps:
135+
- uses: actions/checkout@v4
136+
- name: Install Dependencies
137+
run: |
138+
apt-get update
139+
apt-get install -y lsb-release sudo curl python3 python3-pip python3-venv
140+
- name: Setup Virtual Environment
141+
run: |
142+
python3 -m venv venv
143+
./venv/bin/pip install --upgrade pip
144+
- name: Install Ansible and Requirements
145+
run: |
146+
./venv/bin/pip install -r requirements.txt
147+
./venv/bin/pip install ansible
148+
- name: Run Playbook
149+
run: |
150+
ANSIBLE_ROLES_PATH=../ ./venv/bin/ansible-playbook playbook.yml --extra-vars "nodejs_version=${{ matrix.node_version }}" --ask-become-pass
151+
- name: Check Installed Node.js Version
152+
shell: bash
153+
run: |
154+
NODE_VERSION_INSTALLED=$(node -v | cut -d. -f1 | sed 's/v//')
155+
NODE_VERSION_EXPECTED=$(echo "${{ matrix.node_version }}" | cut -d. -f1)
156+
if [[ "$NODE_VERSION_INSTALLED" != "$NODE_VERSION_EXPECTED" ]]; then
157+
echo "Node.js version mismatch: expected $NODE_VERSION_EXPECTED, got $NODE_VERSION_INSTALLED"
158+
exit 1
159+
else
160+
echo "Node.js version correctly installed: $NODE_VERSION_INSTALLED"
161+
fi

README.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ Currently, this role supports the following operating systems and releases:
99
- **Ubuntu 20.04 LTS** (Focal Fossa)
1010
- **Ubuntu 22.04 LTS** (Jammy Jellyfish)
1111
- **Ubuntu 24.04 LTS** (Noble Numbat)
12-
- **Debian 10** (Buster)
1312
- **Debian 11** (Bullseye)
1413
- **Debian 12** (Bookworm)
1514

@@ -23,8 +22,6 @@ To install and test this role locally, run:
2322
ANSIBLE_ROLES_PATH=../ ansible-playbook playbook.yml --ask-become-pass
2423
```
2524

26-
````
27-
2825
### Install via Ansible Galaxy
2926

3027
You can install this role directly from Ansible Galaxy:
@@ -72,5 +69,3 @@ Maintained by NodeSource.
7269
## License
7370

7471
This code is licensed under the MIT License. See the included [LICENSE.md](./LICENSE.md) file for more details.
75-
76-
````

meta/main.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ galaxy_info:
1515
- noble
1616
- name: Debian
1717
versions:
18-
- buster
1918
- bullseye
2019
- bookworm
2120
- name: EL

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ansible==11.2.0
1+
ansible

0 commit comments

Comments
 (0)