Skip to content

Commit c14f0dd

Browse files
committed
Fix lint issues and dump Travis CI. Try out GitHub Actions instead.
1 parent 98c1190 commit c14f0dd

File tree

13 files changed

+133
-24
lines changed

13 files changed

+133
-24
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# These are supported funding model platforms
2-
2+
---
33
github: geerlingguy
44
patreon: geerlingguy

.github/workflows/ci.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
name: CI
3+
'on':
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
schedule:
9+
- cron: "0 5 * * 4"
10+
11+
jobs:
12+
13+
lint:
14+
name: Lint
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Check out the codebase.
18+
uses: actions/checkout@v2
19+
20+
- name: Set up Python 3.
21+
uses: actions/setup-python@v2
22+
with:
23+
python-version: '3.x'
24+
25+
- name: Install test dependencies.
26+
run: pip3 install yamllint ansible-lint
27+
28+
- name: Lint code.
29+
run: |
30+
yamllint .
31+
ansible-lint
32+
33+
integration:
34+
name: Integration
35+
runs-on: ${{ matrix.os }}
36+
strategy:
37+
matrix:
38+
os:
39+
- macos-10.15
40+
41+
steps:
42+
- name: Check out the codebase.
43+
uses: actions/checkout@v2
44+
45+
- name: Uninstall GitHub Actions' built-in Homebrew.
46+
run: tests/uninstall-homebrew.sh
47+
48+
- name: Uninstall GitHub Actions' built-in browser installs.
49+
run: |
50+
sudo rm -rf /Applications/Firefox.app
51+
sudo rm -rf /Applications/Google\ Chrome.app
52+
53+
- name: Install test dependencies.
54+
run: sudo pip3 install ansible
55+
56+
- name: Set up the test environment.
57+
run: |
58+
cp tests/ansible.cfg ./ansible.cfg
59+
cp tests/inventory ./inventory
60+
cp tests/config.yml ./config.yml
61+
ansible-galaxy install -r requirements.yml -p ./roles
62+
63+
- name: Test the playbook's syntax.
64+
run: ansible-playbook tests/test.yml --syntax-check
65+
66+
- name: Test the playbook.
67+
run: ansible-playbook tests/test.yml
68+
env:
69+
ANSIBLE_FORCE_COLOR: '1'
70+
71+
- name: Idempotence check.
72+
run: |
73+
idempotence=$(mktemp)
74+
ansible-playbook tests/test.yml | tee -a ${idempotence}
75+
tail ${idempotence} | grep -q 'changed=0.*failed=0' && (echo 'Idempotence test: pass' && exit 0) || (echo 'Idempotence test: fail' && exit 1)
76+
env:
77+
ANSIBLE_FORCE_COLOR: '1'

.yamllint

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
extends: default
3+
4+
rules:
5+
line-length:
6+
max: 180
7+
level: warning
8+
9+
ignore: |
10+
.github/stale.yml

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Mac Development Ansible Playbook
44

5-
[![Build Status](https://travis-ci.org/geerlingguy/mac-dev-playbook.svg?branch=master)](https://travis-ci.org/geerlingguy/mac-dev-playbook)
5+
[![CI][badge-gh-actions]][link-gh-actions]
66

77
This playbook installs and configures most of the software I use on my Mac for web and software development. Some things in macOS are slightly difficult to automate, so I still have some manual installation steps, but at least it's all documented here.
88

@@ -177,3 +177,6 @@ Check out [Ansible for DevOps](https://www.ansiblefordevops.com/), which teaches
177177
## Author
178178
179179
[Jeff Geerling](https://www.jeffgeerling.com/), 2014 (originally inspired by [MWGriffin/ansible-playbooks](https://github.com/MWGriffin/ansible-playbooks)).
180+
181+
[badge-gh-actions]: https://github.com/geerlingguy/mac-dev-playbook/workflows/CI/badge.svg?event=push
182+
[link-gh-actions]: https://github.com/geerlingguy/mac-dev-playbook/actions?query=workflow%3ACI

default.config.yml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
---
22
downloads: ~/.ansible-downloads/
33

4-
configure_dotfiles: yes
5-
configure_terminal: yes
6-
configure_osx: yes
4+
configure_dotfiles: true
5+
configure_terminal: true
6+
configure_osx: true
77

8-
configure_sudoers: no
8+
configure_sudoers: false
99
sudoers_custom_config: ''
1010
# Example:
1111
# sudoers_custom_config: |
1212
# # Allow users in admin group to use sudo with no password.
1313
# %admin ALL=(ALL) NOPASSWD: ALL
1414

1515
dotfiles_repo: https://github.com/geerlingguy/dotfiles.git
16-
dotfiles_repo_accept_hostkey: yes
16+
dotfiles_repo_accept_hostkey: true
1717
dotfiles_repo_local_destination: ~/Development/GitHub/dotfiles
1818
dotfiles_files:
1919
- .zshrc
@@ -80,21 +80,21 @@ osx_script: "~/.osx --no-restart"
8080
# Note: You are responsible for making sure the required package managers are
8181
# installed, eg. through homebrew.
8282
composer_packages: []
83-
# - name: drush
84-
# state: present # present/absent, default: present
85-
# version: "^8.1" # default: N/A
83+
# - name: drush
84+
# state: present # present/absent, default: present
85+
# version: "^8.1" # default: N/A
8686
gem_packages: []
87-
# - name: bundler
88-
# state: present # present/absent/latest, default: present
89-
# version: "~> 1.15.1" # default: N/A
87+
# - name: bundler
88+
# state: present # present/absent/latest, default: present
89+
# version: "~> 1.15.1" # default: N/A
9090
npm_packages: []
91-
# - name: webpack
92-
# state: present # present/absent/latest, default: present
93-
# version: "^2.6" # default: N/A
91+
# - name: webpack
92+
# state: present # present/absent/latest, default: present
93+
# version: "^2.6" # default: N/A
9494
pip_packages: []
95-
# - name: mkdocs
96-
# state: present # present/absent/latest, default: present
97-
# version: "0.16.3" # default: N/A
95+
# - name: mkdocs
96+
# state: present # present/absent/latest, default: present
97+
# version: "0.16.3" # default: N/A
9898

9999
# Glob pattern to ansible task files to run after all other tasks are finished.
100100
post_provision_tasks: []

tasks/ansible-setup.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
file:
99
path: /etc/ansible
1010
state: directory
11-
become: yes
11+
become: true
1212

1313
- name: Symlink /usr/local/etc/ansible to /etc/ansible.
1414
file:

tasks/extra-packages.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
name: "{{ item.name | default(item) }}"
1313
state: "{{ item.state | default('present') }}"
1414
version: "{{ item.version | default(omit) }}"
15-
global: yes
15+
global: true
1616
executable: "{{ item.executable | default(omit) }}"
1717
with_items: "{{ npm_packages }}"
1818

@@ -29,6 +29,6 @@
2929
name: "{{ item.name | default(item) }}"
3030
state: "{{ item.state | default('present') }}"
3131
version: "{{ item.version | default(omit) }}"
32-
user_install: no
32+
user_install: false
3333
executable: "{{ item.executable | default(omit) }}"
3434
with_items: "{{ gem_packages }}"

tasks/sudoers.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@
1818
dest: /private/etc/sudoers.d/custom
1919
mode: 0440
2020
validate: 'visudo -cf %s'
21-
become: yes
21+
become: true

tasks/terminal.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
shell: defaults read com.apple.terminal 'Default Window Settings'
55
register: terminal_theme
66
changed_when: false
7-
check_mode: no
7+
check_mode: false
88

99
- name: Ensure custom Terminal profile is added.
1010
shell: open files/terminal/JJG-Term.terminal

tests/ansible.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[defaults]
2+
inventory = inventory
3+
roles_path = ../:../roles:./roles

0 commit comments

Comments
 (0)