Skip to content

Commit

Permalink
Merge pull request #10 from Oefenweb/make-use-of-github-actions
Browse files Browse the repository at this point in the history
Make use of github actions
  • Loading branch information
tersmitten authored Jan 20, 2021
2 parents ec9ceed + 24b769a commit 8ea1d57
Show file tree
Hide file tree
Showing 19 changed files with 187 additions and 105 deletions.
2 changes: 2 additions & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
warn_list:
- '106'
80 changes: 80 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
---
name: CI
'on':
pull_request:
push:
branches:
- master
schedule:
- cron: '30 1 * * 3'

jobs:

lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Check out the codebase
uses: actions/checkout@v2

- name: Set up Python 3
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: Install test dependencies
run: pip install yamllint ansible-lint

- name: Lint code
run: |
yamllint .
ansible-lint
molecule:
name: Molecule
runs-on: ubuntu-latest
defaults:
run:
working-directory: "${{ github.repository }}"
needs:
- lint
strategy:
fail-fast: false
matrix:
include:
- distro: debian8
- distro: debian9
- distro: debian10
- distro: ubuntu1604
ansible-version: '>=2.8, <2.9'
- distro: ubuntu1604
ansible-version: '>=2.9, <2.10'
- distro: ubuntu1604
ansible-version: '>=2.10, <2.11'
- distro: ubuntu1604
- distro: ubuntu1804
- distro: ubuntu2004

steps:
- name: Check out the codebase
uses: actions/checkout@v2
with:
path: "${{ github.repository }}"

- name: Set up Python 3
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: Install test dependencies
run: pip install 'ansible${{ matrix.ansible-version }}' molecule[docker] docker

- name: Run Molecule tests
run: |
molecule test
env:
ANSIBLE_FORCE_COLOR: '1'
ANSIBLE_VERBOSITY: '2'
MOLECULE_DEBUG: '1'
MOLECULE_DISTRO: "${{ matrix.distro }}"
PY_COLORS: '1'
20 changes: 20 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Release
'on':
push:
tags:
- '*'

jobs:

release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Check out the codebase
uses: actions/checkout@v2

- name: Publish to Galaxy
uses: robertdebock/galaxy-action@1.1.0
with:
galaxy_api_key: ${{ secrets.GALAXY_API_KEY }}
81 changes: 0 additions & 81 deletions .travis.yml

This file was deleted.

15 changes: 15 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
extends: default

rules:
braces:
max-spaces-inside: 1
level: error
brackets:
max-spaces-inside: 1
level: error
line-length: disable
truthy: disable

ignore: |
.tox/
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ RUN rm -rf $HOME/.cache
# ansible
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y gcc libffi-dev libssl-dev && \
apt-get clean
RUN pip install ansible==2.9.14
RUN pip install ansible==2.9.15
RUN rm -rf $HOME/.cache

# provision
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## rstudio

[![Build Status](https://travis-ci.org/Oefenweb/ansible-rstudio.svg?branch=master)](https://travis-ci.org/Oefenweb/ansible-rstudio)
[![CI](https://github.com/Oefenweb/ansible-rstudio/workflows/CI/badge.svg)](https://github.com/Oefenweb/ansible-rstudio/actions?query=workflow%3ACI)
[![Ansible Galaxy](http://img.shields.io/badge/ansible--galaxy-rstudio-blue.svg)](https://galaxy.ansible.com/Oefenweb/rstudio/)

Set up (the latest version of) [RStudio (IDE)](https://www.rstudio.com/products/rstudio/download/) in Debian-like systems.
Expand All @@ -12,7 +12,7 @@ Set up (the latest version of) [RStudio (IDE)](https://www.rstudio.com/products/

#### Variables

* `rstudio_version` [default: `1.2.5033`]: Version to install
* `rstudio_version` [default: `1.4.1103`, `1.2.5042` for `Debian 8`]: Version to install
* `rstudio_install` [default: `[]`]: Additional packages to install (e.g. `r-base`)

## Dependencies
Expand All @@ -22,6 +22,7 @@ None
## Recommended

* `ansible-r` ([see](https://github.com/Oefenweb/ansible-r))
* `ansible-rstudio-server` ([see](https://github.com/Oefenweb/ansible-rstudio-server))

#### Example

Expand Down
14 changes: 7 additions & 7 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@ role = File.basename(File.expand_path(File.dirname(__FILE__)))

boxes = [
{
:name => "ubuntu-1404",
:box => "bento/ubuntu-14.04",
:name => "ubuntu-1604",
:box => "bento/ubuntu-16.04",
:ip => '10.0.0.12',
:cpu => "50",
:ram => "256"
},
{
:name => "ubuntu-1604",
:box => "bento/ubuntu-16.04",
:name => "ubuntu-1804",
:box => "bento/ubuntu-18.04",
:ip => '10.0.0.13',
:cpu => "50",
:ram => "256"
:ram => "384"
},
{
:name => "ubuntu-1804",
:box => "bento/ubuntu-18.04",
:name => "ubuntu-2004",
:box => "bento/ubuntu-20.04",
:ip => '10.0.0.14',
:cpu => "50",
:ram => "384"
Expand Down
2 changes: 1 addition & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# defaults file for rstudio
---
rstudio_version: 1.2.5033
rstudio_version: "{{ '1.2.5042' if ansible_distribution == 'Debian' and ansible_distribution_version is version('8', '<=') else '1.4.1103' }}"
rstudio_install: []
2 changes: 1 addition & 1 deletion meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ galaxy_info:
platforms:
- name: Ubuntu
versions:
- trusty
- xenial
- bionic
- focal
- name: Debian
versions:
- jessie
Expand Down
9 changes: 9 additions & 0 deletions molecule/default/converge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
- name: Converge
hosts: all
become: true
pre_tasks:
- name: include vars
include_vars: "{{ playbook_dir }}/../../tests/vars/main.yml"
roles:
- ../../../
19 changes: 19 additions & 0 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
dependency:
name: galaxy
driver:
name: docker
platforms:
- name: instance
image: "geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu1604}-ansible:latest"
command: ${MOLECULE_DOCKER_COMMAND:-""}
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
privileged: true
pre_build_image: true
provisioner:
name: ansible
playbooks:
prepare: prepare.yml
converge: converge.yml
verify: verify.yml
5 changes: 5 additions & 0 deletions molecule/default/prepare.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
- name: Prepare
hosts: all
become: true
tasks: []
5 changes: 5 additions & 0 deletions molecule/default/verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
- name: Verify
hosts: all
become: true
tasks: []
12 changes: 6 additions & 6 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
- "_{{ ansible_distribution | lower }}.yml"
- _default.yml
tags:
- configuration
- rstudio
- rstudio-include-variables
- configuration
- rstudio
- rstudio-include-variables

- include: install.yml
tags:
- configuration
- rstudio
- rstudio-install
- configuration
- rstudio
- rstudio-install
6 changes: 3 additions & 3 deletions tests/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
- hosts: localhost
connection: local
become: true
pre_tasks:
- name: include vars
include_vars: "{{ playbook_dir }}/vars/main.yml"
roles:
- ../../
vars:
rstudio_install:
- r-base
6 changes: 3 additions & 3 deletions tests/vagrant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
- hosts: all
remote_user: vagrant
become: true
pre_tasks:
- name: include vars
include_vars: "{{ playbook_dir }}/vars/main.yml"
roles:
- ../../
vars:
rstudio_install:
- r-base
4 changes: 4 additions & 0 deletions tests/vars/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# vars file for rstudio
---
rstudio_install:
- r-base
3 changes: 3 additions & 0 deletions vars/_focal.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# vars file for rstudio
---
rstudio_download_url: "https://download1.rstudio.org/desktop/bionic/{{ rstudio_machine_map[ansible_machine] }}/rstudio-{{ rstudio_version }}-{{ rstudio_machine_map[ansible_machine] }}.deb"

0 comments on commit 8ea1d57

Please sign in to comment.