forked from leonidas/ansible-nvm
-
Notifications
You must be signed in to change notification settings - Fork 18
33 lines (33 loc) · 1.15 KB
/
ci.yaml
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
name: Continuous Integration
on: push
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run linter
uses: ansible/ansible-lint@v6
- name: Syntax Check
run: ansible-playbook -i "localhost," test.yml --syntax-check
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Ansible
run: pip install ansible
- name: First run
run: ansible-playbook -i "localhost," -c local test.yml --extra-vars "ansible_python_interpreter=auto nvm_install_path=~/.nvmbis"
- name: Second run
run: >
ansible-playbook -i "localhost," -c local test.yml --extra-vars "ansible_python_interpreter=auto nvm_install_path=~/.nvmbis"
| grep -q 'changed=0.*failed=0'
&& (echo 'Idempotence test: pass' && exit 0)
|| (echo 'Idempotence test: fail' && exit 1)
- name: Check nvm version
run: . ~/.profile && nvm --version | grep 0.31.5
- name: Check Node.js version
run: . ~/.profile && node --version | grep 6.9.1