File tree Expand file tree Collapse file tree 12 files changed +87
-157
lines changed Expand file tree Collapse file tree 12 files changed +87
-157
lines changed Original file line number Diff line number Diff line change 1
1
---
2
2
skip_list:
3
3
- '503'
4
+ - role-name
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ ---
2
+ jobs :
3
+ test :
4
+ name : molecule test
5
+ runs-on : ubuntu-latest
6
+ steps :
7
+ - uses : actions/checkout@v1
8
+ - name : Setup Python
9
+ uses : actions/setup-python@v1
10
+ with :
11
+ python-version : 3.8
12
+ - name : Install required dependencies
13
+ run : pip install -r requirements.txt
14
+ - run : molecule test --all
15
+ name : Molecule Test
16
+ ' on ' :
17
+ - push
Original file line number Diff line number Diff line change
1
+ ---
2
+ jobs :
3
+ release :
4
+ env :
5
+ GITHUB_TOKEN : ' ${{ secrets.GH_TOKEN }}'
6
+ runs-on : ubuntu-latest
7
+ steps :
8
+ - name : Checkout
9
+ uses : actions/checkout@v1
10
+ - name : Release
11
+ uses : cycjimmy/semantic-release-action@v2.1.3
12
+ with :
13
+ branch : master
14
+ extra_plugins : |
15
+ @semantic-release/changelog
16
+ @semantic-release/git@8.0.0
17
+ name : Release
18
+ on :
19
+ push :
20
+ branches :
21
+ - master
Original file line number Diff line number Diff line change
1
+ ---
1
2
extends: default
2
3
3
4
rules:
Original file line number Diff line number Diff line change @@ -3,7 +3,8 @@ Ansible role for nodejs
3
3
4
4
Installs NodeJS toolchain
5
5
6
- [ ![ CircleCI] ( https://img.shields.io/circleci/build/github/mongodb-ansible-roles/ansible-role-nodejs-toolchain/master?style=flat-square )] ( https://circleci.com/gh/mongodb-ansible-roles/ansible-role-nodejs-toolchain )
6
+ [ ![ GitHub Actions] ( https://github.com/mongodb-ansible-roles/ansible-role-nodejs-toolchain/workflows/Molecule%20Test/badge.svg )] ( https://github.com/mongodb-ansible-roles/ansible-role-nodejs-toolchain/actions?query=workflow%3A%22Molecule+Test%22 )
7
+ [ ![ GitHub Actions] ( https://github.com/mongodb-ansible-roles/ansible-role-nodejs-toolchain/workflows/Release/badge.svg )] ( https://github.com/mongodb-ansible-roles/ansible-role-nodejs-toolchain/actions?query=workflow%3A%22Release%22 )
7
8
8
9
Requirements
9
10
------------
@@ -34,19 +35,6 @@ Example Playbook
34
35
nodejs_toolchain_version : " v8.11.3"
35
36
` ` `
36
37
37
- Development
38
- -----------
39
-
40
- Testing this role locally requires the CircleCI [Local CLI](https://circleci.com/docs/2.0/local-cli/).
41
-
42
- To install the CLI for macOS and Linux, invoke the following command:
43
-
44
- $ curl -fLSs https://circle.ci/cli | DESTDIR=/usr/local/bin bash
45
-
46
- After installing the CLI, invoke the following command to run the Molecule tests:
47
-
48
- $ make test
49
-
50
38
License
51
39
-------
52
40
Original file line number Diff line number Diff line change @@ -6,7 +6,8 @@ dependencies:
6
6
toolchain_url : " {{ nodejs_toolchain_url }}"
7
7
toolchain_version : " {{ nodejs_toolchain_version }}"
8
8
galaxy_info :
9
- author : MongoDB
9
+ role_name : ansible_role_nodejs_toolchain
10
+ author : mongodb
10
11
description : Installs NodeJS toolchain
11
12
license : Apache
12
13
min_ansible_version : 2.8
File renamed without changes.
Original file line number Diff line number Diff line change @@ -3,16 +3,15 @@ dependency:
3
3
name : galaxy
4
4
driver :
5
5
name : docker
6
- lint :
7
- name : yamllint
6
+ lint : |
7
+ set -e
8
+ yamllint .
9
+ ansible-lint
10
+ flake8
8
11
platforms :
9
- - name : instance
10
- image : debian:9
12
+ - name : ubuntu2004
13
+ image : ubuntu:20.04
11
14
provisioner :
12
15
name : ansible
13
- lint :
14
- name : ansible-lint
15
16
verifier :
16
- name : inspec
17
- lint :
18
- name : rubocop
17
+ name : testinfra
Original file line number Diff line number Diff line change
1
+ import os
2
+
3
+ import testinfra .utils .ansible_runner
4
+
5
+ testinfra_hosts = testinfra .utils .ansible_runner .AnsibleRunner (
6
+ os .environ ['MOLECULE_INVENTORY_FILE' ]
7
+ ).get_hosts ('all' )
8
+
9
+
10
+ def test_nodejs (host ):
11
+ cmd = host .run ("/opt/node/bin/node --version" )
12
+ assert cmd .stdout == """v8.11.3"""
13
+
14
+ cmd = host .run ("node --version" )
15
+ assert cmd .stdout == """v8.11.3"""
16
+
17
+ cmd = host .run ("/opt/node/bin/npm --version" )
18
+ assert cmd .stdout == """5.6.0"""
19
+
20
+ cmd = host .run ("npm --version" )
21
+ assert cmd .stdout == """5.6.0"""
22
+
23
+ cmd = host .run ("/opt/node/bin/npx --version" )
24
+ assert cmd .stdout == """9.7.1"""
25
+
26
+ cmd = host .run ("npx --version" )
27
+ assert cmd .stdout == """9.7.1"""
28
+
29
+ assert host .file ("/root/.npmrc" ).exists
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ docker
2
+ molecule == 3.6.1
3
+ molecule [docker ]
4
+ ansible-lint == 4.2.0
5
+ flake8 == 3.7.9
6
+ testinfra == 4.1.0
You can’t perform that action at this time.
0 commit comments