Skip to content

Commit cd35372

Browse files
committed
chore: switch from circleCI to github actions
1 parent c23d4ba commit cd35372

File tree

12 files changed

+87
-157
lines changed

12 files changed

+87
-157
lines changed

.ansible-lint

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
---
22
skip_list:
33
- '503'
4+
- role-name

.circleci/config.yml

Lines changed: 0 additions & 39 deletions
This file was deleted.

.github/workflows/molecule.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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

.yamllint

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
extends: default
23

34
rules:

README.md

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ Ansible role for nodejs
33

44
Installs NodeJS toolchain
55

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)
78

89
Requirements
910
------------
@@ -34,19 +35,6 @@ Example Playbook
3435
nodejs_toolchain_version: "v8.11.3"
3536
```
3637
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-
5038
License
5139
-------
5240

meta/main.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ dependencies:
66
toolchain_url: "{{ nodejs_toolchain_url }}"
77
toolchain_version: "{{ nodejs_toolchain_version }}"
88
galaxy_info:
9-
author: MongoDB
9+
role_name: ansible_role_nodejs_toolchain
10+
author: mongodb
1011
description: Installs NodeJS toolchain
1112
license: Apache
1213
min_ansible_version: 2.8
File renamed without changes.

molecule/default/molecule.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,15 @@ dependency:
33
name: galaxy
44
driver:
55
name: docker
6-
lint:
7-
name: yamllint
6+
lint: |
7+
set -e
8+
yamllint .
9+
ansible-lint
10+
flake8
811
platforms:
9-
- name: instance
10-
image: debian:9
12+
- name: ubuntu2004
13+
image: ubuntu:20.04
1114
provisioner:
1215
name: ansible
13-
lint:
14-
name: ansible-lint
1516
verifier:
16-
name: inspec
17-
lint:
18-
name: rubocop
17+
name: testinfra
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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

molecule/default/verify.yml

Lines changed: 0 additions & 94 deletions
This file was deleted.

requirements.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
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

0 commit comments

Comments
 (0)